摘要:
二叉排序树插入结点BSTree *InsertBST(BSTree *bst,int key) //插入节点{ BSTree *p,*s,*pre; s=(BSTree*)malloc(sizeof(BSTreeNode)); s->data=key; s->lchild=s->rchild=NULL; if(bst==NULL) { bst=s; return bst; } p=bst; while(p) { pre=p;//指向其父节点 if(p->data==key)return p; else if(p->data>key)p=p->lchil 阅读全文