1.求二叉树的深度
int TreeDepth(binary_Tree* pRoot) { if(pRoot==NULL) return 0; int nLeft=TreeDepth(pRoot->left); int nRight=TreeDepth(pRoot->right); return (nLeft>nRight) ? (nLeft+1):(nRight+1) }
posted on 2014-08-31 16:43 雨钝风轻 阅读(334) 评论(0) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 雨钝风轻 Powered by .NET 9.0 on Kubernetes