- 博客(9)
- 资源 (16)
- 收藏
- 关注
原创 ConvertBST2DoubleList
void Convert(Node * r,Node * & first,Node * & last){ Node *firstL,*lastL,*firstR,*lastR; if(r==NULL) return; Convert(r->left,firstL,lastL); Convert(r->right,firstR,lastR);
2012-02-22 13:44:17 442
原创 bit_map
unsigned char flags[1000];int getv(int idx){ int i=idx>>3; int j=idx&0x7; //return ((flags[i]&(0x1>j); return ((flags[i]>>j)&0x01);}int setv(int idx){ int i=idx>>3; int
2012-02-22 13:20:04 584
原创 findMaxDistance
int BTNodeDepth(BTNode *b){ int lchilddep,rchilddep; if(b==NULL) return 0; else { lchilddep=BTNodeDepth(b->lchild); rchilddep=BTNodeDepth(b->rchild); r
2012-02-17 20:16:27 714
原创 abc
C++语言: static int dictExpand(dict*ht,unsigned long size) { dict n; /* the new hashtable */ unsigned long realsize= _dictNextPower(size),i; /* the size is invalid if it
2012-02-16 11:22:33 540
原创 CreateBTfromPre
BTNode *CreateBTfromPre(char *pre,char *in,int n,int m){ BTNode *s; char *p,*q,*minp; int minpre,minin ,k; if(n<=0) return NULL; minpre=m+1; for(p=in;p<in+n;p++) for(q
2012-02-15 16:52:59 693
原创 insertNew
void insertNew(BTNode *tree, BTNode *new_node){ int llcnt(0),lrcnt(0),rrcnt(0); BTNode *lch,*rch,*p,*lb; if(tree->lchild==NULL)//insert tree->lchild=new_node; else if(tree->rc
2012-02-15 15:46:44 611
原创 CreatBT
BTNode *CreatBT(char *post,char *in,int n,int m){ BTNode *s; char *p,*q,*maxp; int maxpost,maxin ,k; if(n<=0) return NULL; maxpost=-1; for(p=in;p<in+n;p++) for(q=post;q<post+m;q++) if(*p==
2012-02-15 14:31:38 604
原创 find_mid
int find_mid( int *a, int *b, int length){ if (length == 1)//这里应该根据中位数的定义取大小 return a[0]<b[0]?a[0]:b[0]; int i = length/2; if (a[i] == b[i]) return a[i]; else if (a[i
2012-02-15 14:04:34 538
原创 find_seq
int cnt(0);int howmany(0);void find_seq(int A1, int n, int sum){ howmany++; int tmp=(A1+(n-1)/2.0)*n; if(tmp > sum) return; else if(tmp==sum) { cout<<"the seque
2012-02-15 14:01:07 573
C++面向对象多线程编程
2017-07-28
C Primer Plus(第五版)中文版
2017-07-28
Erlang程序设计(中文版)
2017-07-28
代码的未来 - 松本行弘
2017-07-28
RESTful Web APIs
2017-07-28
MySQL技术内幕:InnoDB存储引擎-姜承尧
2017-07-28
流畅的Python(Fluent Python)
2017-07-28
Visual C++ MFC入门教程
2010-02-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人