Reputation: 10375
Suppose we have a modified AVL Tree, in which we allow the subtrees to have a height difference of 2 (instead of the standard 1). The operation time would now be log(n+1) which is still O(log n).
Would coding such a tree be significantly different than a standard AVL Tree?
Would it be as efficient?
Upvotes: 0
Views: 568
Reputation: 1647
It would be harder to balance, since when deleting a node you could end up with two subtrees of height difference 4.
Upvotes: 1