先简单介绍下先序遍历、中序遍历和后序遍历,先序遍历为ABC,中序遍历为BAC,后续遍历为BCA,根节点在的位置决定了什么遍历。该题的递归解法:class Solution {public: typedef TreeNode * STreeNode; vector buf; vector pos...
分类:
其他好文 时间:
2014-12-20 19:36:13
阅读次数:
178
Interleaving Positive and Negative Numbers 原题链接 : http://lintcode.com/zh-cn/problem/interleaving-positive-and-negative-numbers/Given an array with pos...
分类:
其他好文 时间:
2014-12-20 18:08:37
阅读次数:
404
问题类型:需要进行n个数的全排列再进行其他操作O(2^n)
c++代码实现:
#include
using namespace std;
int perm[11],pos,n;
bool mapp[11]={0};
void perm1(int pos,int n)
{
if(pos==n+1)
{
for(int k=1;k<=n;k++)
...
分类:
其他好文 时间:
2014-12-19 22:03:01
阅读次数:
140
WebService原理WebService是一种跨编程语言和跨操作系统平台的远程调用技术所谓远程调用,就是一台计算机a上的一个程序能够调用到另外一台计算机b上的一个对象的方法,譬如,银联提供给商场的pos刷卡系统(採用交互提问的方式来加深大家对此技术的理解)。远程调用技术有什么用呢?商场的POS机...
分类:
Web程序 时间:
2014-12-19 13:01:26
阅读次数:
238
也是几百年没做CF咯,这场还是赛后做的,退化很多啦A.Digital Counter找规律 可能有火柴棍丢失,问你可能组成的数字有多少种,只需要肉眼看看每个数字填上火柴棍可能形成的数字,打个表就行了#include #include using namespace std;const int pos...
分类:
其他好文 时间:
2014-12-18 01:31:49
阅读次数:
234
1 CComBSTR bstr;2 pDoc->get_FileName(&bstr);3 CString cstring(bstr);4 int len = cstring.GetLength();5 int pos = cstring.ReverseFind('\...
分类:
其他好文 时间:
2014-12-17 16:14:15
阅读次数:
189
http://blog.csdn.net/ice110956/article/details/17090061整理至11月中旬在重庆参加的自然语言处理与机器学习会议,第一讲为自然语言处理。由基本理论到实际运用,整理了基本的框架。1.自然语言处理基础词性标注(POS):为句子中的每个词语标注词性,可看...
分类:
编程语言 时间:
2014-12-16 13:18:08
阅读次数:
303
SQL 中的 substring 函数是用来抓出一个栏位资料中的其中一部分。这个函数的名称在不同的资料库中不完全一样:
MySQL: SUBSTR( ), SUBSTRING( )Oracle: SUBSTR( )SQL Server: SUBSTRING( )
最常用到的方式如下 (在这里我们用 SUBSTR( ) 为例):
SUBSTR (str, pos)
由 中,选出...
分类:
数据库 时间:
2014-12-15 20:26:51
阅读次数:
165
#include
using namespace std;
int bottom_up_cut_rod(int p[],int n,int &pos)
{
int *r=new int[n+1];
int *s=new int[n+1];
for(int i=0;i<=n;++i)
s[i]=0;
for(int i=0;i<=n;++i)
r[i]=0;
for(int j=1...
分类:
编程语言 时间:
2014-12-15 20:21:15
阅读次数:
340
玩家移动//好长时间没看这些,好多都看不懂了void Map::UpdatePlayerPos(TgtPos pos, PlayerInfo* pl){// m_pLog->Logs(eLogLevel_Warning, "人物移动"); // 检查位置包 auto& mpos =...
分类:
移动开发 时间:
2014-12-14 00:31:14
阅读次数:
305