二叉树——最大叶子间距

题目:结点编号从0开始,而后给出每一个结点左右子树的编号,其中-1表示为NIL,求最大叶子间距web 方法一: 方法有点糙,就是求得任意两个结点的间距,从而可得最大叶子间距数组 1 . 建树svg const int N = 10005; typedef struct { int parent; int lchild, rchild; }BT; BT bt[N]; int n; i
相关文章
相关标签/搜索