Home > Back-end >  To recognize to ask a simple question
To recognize to ask a simple question

Time:09-26

In binary tree height, why GetHeight (BT - & gt; Left) can return an integer? I hope can help solve, thank you! (answer the second situation can only)


CodePudding user response:

The return value of a function int isn't it?

CodePudding user response:

Max as a counter, from the left and right subtrees both sides go down, since every one plus one, finally return to the left, right in the greater number
  • Related