mymalloc兄弟.docVIP

  • 3
  • 0
  • 约6.62万字
  • 约 6页
  • 2016-12-25 发布于河南
  • 举报
#include stdio.h #include string.h #include stdlib.h #include iostream #include math.h using namespace std; int m; class WORD { public: WORD * llink; WORD * rlink; int tag; int kval; }; WORD *space; class NODE { public: int nodesize; WORD * first; }; class LINK { public: NODE *n; LINK() { n=(NODE*)malloc(sizeof(NODE)*(m+1)); for(int i=0;i=m;i++) { n[i].nodesize=i; n[i].first=NULL; } n[m].first=space; space-llink=space; space-rlink=space; space-tag=0; space-kval=m; } void insert(WORD * w,int a) { WORD *p=n[a].first; if(p==NULL) { n[a].first=w;

文档评论(0)

1亿VIP精品文档

相关文档