下列算法的功能是求出指定结点在给定的二叉排序树中所在的层次。请完善该算法。
Void level(BSTree root,p)
{ int level=0;
if( !root )
(1)_________;
else {
level++;
while( root->key!=p->key ) {
if( root->key
(2)_________ ;
else
(3)_________ ;
level++;
}
(4)_________;
}
}
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服