摘要: View Code 1 #include <stdlib.h> 2 #include <string.h> 3 #include <stdio.h> 4 void Reverse(char *pbegin,char *pend) 5 { 6 char temp; 7 while(pbegin < pend) 8 { 9 temp = *pbegin;10 *pbegin = *pend;11 *pend = temp;12 pbegin++;13 pend--;14 }15 }16... 阅读全文
posted @ 2012-09-06 23:24 l851654152 阅读(148) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include <stdio.h> 2 bool VerifySquenceBST(int *Squence,int length) 3 { 4 if(Squence == NULL || length <= 0) return false; 5 int root = Squence[length - 1]; 6 for(int i = 0;i < length-1;++i) 7 { 8 if(Squence[i] > root) break; 9 }10 int j = i;11 for(;j... 阅读全文
posted @ 2012-09-06 22:51 l851654152 阅读(208) 评论(0) 推荐(0) 编辑
摘要: View Code 1 int FindPath(BITREE T,int key,int &cursum,std::vector<int>& vec) 2 { 3 if(!T) return 0; 4 cursum += T->elem; 5 vec.push_back(T->elem); 6 7 bool isLeaf = (!T->lchild && !T->rchild); 8 9 if(key == cursum && isLeaf)10 {11 vector<int>::iterator 阅读全文
posted @ 2012-09-06 21:07 l851654152 阅读(201) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include <stdio.h> 2 3 int main() 4 { 5 int subsum = 0; 6 int great = 0; 7 int a[8] = {1,-2,3,10,-4,7,2,-5}; 8 for(int i = 0;i < 8;i++) 9 {10 subsum = subsum + a[i];11 if(subsum < 0) subsum = 0;12 if(subsum > great)13 {14 ... 阅读全文
posted @ 2012-09-06 20:32 l851654152 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://www.cppblog.com/Joe/category/16955.htmlhttp://www.cppblog.com/menjitianya/archive/2011/05/26/147205.htmlhttp://www.cnblogs.com/sopc-mc/archive/2011/10/28/2228179.htmlhttp://www.cppblog.com/Joe/archive/2011/05/25/147091.html?opt=admin 阅读全文
posted @ 2012-09-06 14:35 l851654152 阅读(108) 评论(0) 推荐(0) 编辑