int LeavesNodeNum(Node *pRoot)
{
    if (!pRoot)
        return 0;
    if (!pRoot->pLeft && !pRoot->pRight)
        return 1;
    return LeavesNodeNum(pRoot->pLeft) + LeavesNodeNum(pRoot->pRight);
}

 

 

 

 

 

 

EOF

相关文章:

  • 2021-08-21
  • 2022-12-23
  • 2021-08-29
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-03
  • 2022-02-01
  • 2021-09-17
  • 2022-12-23
相关资源
相似解决方案