0

I was just reading this (http://condor.depaul.edu/ntomuro/courses/417/notes/lecture1.html) paper which proves the minimum number of nodes in an AVL-Tree. Yet, I do not understand the meaning of the result, since O(log n) is not referring to the number of nodes at all. How can this be a prove? I do however understand the first steps and how the iterations are simplified. But after the 4th step I am failing to understand what he is exactly doing (even though I can vaguely imagine). Could anybody please explain to me, what the last few lines are proving and how he is simplifying expressions at the end of part 1?

Thanks

Henry
  • 727
  • 1
  • 6
  • 25

1 Answers1

1

O(logn) does refer to nodes. "n" represents the the number of nodes. You can think about it intuitively by realizing that the number of nodes on each subsequent level doubles. Because it's an AVL tree, the previous level has to be full before pushing nodes to the next level. This restricts the height of the tree to logn because of the fact that each layer doubles the number of nodes. In other words, the number of nodes can be written as nodes=2^height - 1. When you solve for the height and round you get logn.

mban
  • 422
  • 1
  • 6
  • 19