首页 > 试题广场 >

下面程序段的功能是实现在二叉排序树中插入一个新结点,请在下划

[填空题]

下面程序段的功能是实现在二叉排序树中插入一个新结点,请在下划线处填上正确的内容。

typedef struct node{int data;struct node *lchild;struct node  *rchild;}bitree;

void  bstinsert(bitree *&t,int k)

{

if (t==0 ) {______________1______________;t->data=k;t->lchild=t->rchild=0;}

else if (t->data>k) bstinsert(t->lchild,k);else____________2______________;

}

这道题你会答吗?花几分钟告诉大家答案吧!