int GetNodeNumKthLevel(Node *pRoot, int k)
{
    if (!pRoot || k < 1)
        return 0;

    if (k = 1)
        return 1;

    return GetNodeNumKthLevel(pRoot->pLeft, k-1) + GetNodeNumKthLevel(pRoot->pRight, k-1);
}

 

 

 

 

 

EOF

相关文章:

  • 2021-07-08
  • 2022-12-23
  • 2021-11-12
  • 2021-04-26
  • 2021-12-25
  • 2021-05-13
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2021-09-03
  • 2022-12-23
  • 2021-06-25
  • 2021-07-05
  • 2022-01-31
  • 2022-01-17
相关资源
相似解决方案