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) }
函数递归的几个例子
原文:http://www.cnblogs.com/XDJjy/p/3947847.html