What imbalance is fixed by a single right rotation?
What imbalance is fixed by a leftright rotation?
What is the balance factor of an AVL tree node?
In our discussion of the process for rebalancing an AVL tree, we never
discussed the possibility of the balance factor of a node being either +2
or –2 and the balance factor of one of its children being either +2 or –2.
Why not?
Rebalancing an AVL tree is done after either an insertion or a deletion
and it is done starting at the affected node and working up along a
We noted that the balance restriction for a red/black tree is less strict than that
of an AVL tree and yet we still claim that traversing the longest path in a
red/black tree is still O(log n). Why?
Since no red node can have a red child, then at most half of the nodes
What is the difference between a TreeSet and a TreeMap?