已知二叉树的二叉链表类型定义如下:
typedef struct node
{ char data;
struct node * lchild, *rchild;
} BiTNode;
typedef BiNode BiTree;
以下程序为求二叉树深度的递归算法,请填空完普之。
int depth( Bitree *bt) /*bt为指向根结点的指针*/
{ int h1=0, hr =0;
if(___(1)___) return (0);
h1=depth( bt->lchild);
hr= depth (bt->rchild);
if(___(2)___) return (h1+1);
else ___(3)___;
}
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服