Finding the minimum and maximum height in a AVL tree, given a number of nodes?

后端 未结 4 1591
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 06:37

Is there a formula to calculate what the maximum and minimum height for an AVL tree, given a certain number of nodes?

For example:
Textbook question

4条回答
  •  醉酒成梦
    2021-01-31 07:09

    http://lcm.csa.iisc.ernet.in/dsa/node112.html

    It is roughly 1.44 * log n, where n is the number of nodes.

    For a more detailed description on how that was derived. You can refer to this link starting on the middle of page 13: http://www.compsci.hunter.cuny.edu/~sweiss/course_materials/csci335/lecture_notes/chapter04.2.pdf

提交回复
热议问题