随笔分类 - 数据结构代码
摘要:#include #include typedef struct btnode{ int data; struct btnode *lchild,*rchild;}btnode;int b[100];//在二叉树中插入元素btnode *insertnode(btnode *root,int node){ btnode *newnode; btnode *currentnode; btnode *parentnode; newnode=(btnode*)malloc(sizeof(btnode)); newnode->lchild=NULL; n...
阅读全文
摘要:#include #include typedef struct btnode{ int data; struct btnode *lchild,*rchild;}btnode,*btree;//建立二叉树btree createtree(){ btree T; char p; p=getchar(); if (p=='#') T=NULL; else { T=(btree)malloc(sizeof(btnode)); T->data=p; T->lchild=createtree(); ...
阅读全文

浙公网安备 33010602011771号