Are my recursion conditions right to compute binary tree height?

后端 未结 4 1738
既然无缘
既然无缘 2021-01-28 19:59

I\'m trying to know whether my code is right or wrong with your help, because sadly I can\'t run it to check.

There are no compile errors. What I\'m trying to do is to

4条回答
  •  孤城傲影
    2021-01-28 20:34

    At first glance, as long as you pass in the head of the tree, it'll return the correct value. But it should have been easy to construct a test to validate this...

提交回复
热议问题