求二叉树叶子节点的个数
int LeavesNodeNum(Node *pRoot) { if (!pRoot) return 0; if (!pRoot->pLeft && !pRoot->pRight) return 1; return LeavesNodeNum(pRoot->pLeft) + LeavesNodeNum(pRoot->pRight); }
EOF
int LeavesNodeNum(Node *pRoot) { if (!pRoot) return 0; if (!pRoot->pLeft && !pRoot->pRight) return 1; return LeavesNodeNum(pRoot->pLeft) + LeavesNodeNum(pRoot->pRight); }
EOF