I am wondering if there is fundamental issue for AVL tree re-balancing. According to several tutorials, for AVL insertion, maximum 2 rotates it can be balanced. However, it may depend what is called as balanced. Follow link to see the tree.
Originally it has 6 elements. Assume that we inserted the last value as 3 or 4.5 or 5.5 or 6.5. Anyway, it will be inserted on the left side of the bottom. As total 7 element tree, for perfect balancing, I will consider it has only 3 rows.
This will force the new root is 6 or 6.5 (if we insert 6.5). I really cannot figure out a way to rebalancing it within 2 rotations. If we only depends on the "balance" definition, 4-rows is still called balanced, but it will result more searching time.
Am I missing something?
In case the picture got deleted, below is a text version:
7 5 9 4 6 8 Empty_slot 3 or 4.5 or 5.5 or 6.5