~/ learn/ comp-372/ cards/ Balanced trees: the red-black guarantee
1 of 3

What height bound does a red-black tree guarantee, and what does it buy?

What height bound does a red-black tree guarantee, and what does it buy?

Answer

h ≤ 2 lg(n+1) = O(lg n); all dynamic-set operations are O(lg n) worst-case

Properties 4 and 5 cap the longest path at twice the shortest, so height stays logarithmic regardless of insertion order — fixing the BST degeneracy problem.

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/0f68ef17-ec20-42df-8554-d78c2a757f27/flashcard utf-8 LF