Binary Tree Height

后端 未结 8 2068
迷失自我
迷失自我 2020-12-29 12:34

I need a general formula to calculate the minimum height of the binary tree and the maximum height of the binary tree. (not the binary search tree)

8条回答
  •  既然无缘
    2020-12-29 13:14

    The max height is n and the min height (IE a perfect binary tree) is the (log base 2( n + 1)) - 1

提交回复
热议问题