Write a function to find the depth of a binary tree

来源:互联网 发布:怎么检查网络是否联通3 编辑:程序博客网 时间:2024/04/29 19:44
struct Node {T data; Node * left, * right; }; int depth (Node * pNode){ return (pNode == NULL) ? 0 : 1 + max (depth (pNode->left), depth (pNode->right)); }

原创粉丝点击