数据结构--二叉树--求树的深度的算法(树遍历算法的应用)

int TreeDepth(CSTree T) { if(!T) return 0; else{ h1 = TreeDepth(T->firstchild); h2 = TreeDepth(T->nextsibling); return(max(h1+1,h2)); } }
相关文章
相关标签/搜索