Trivia ForgePlay free →

What upper bound does a Red-Black Tree with n internal nodes have on its height?

Show answer

2 log₂(n + 1)

Red-Black Trees are self-balancing binary search trees that use color properties to ensure the path from the root to the furthest leaf is no more than twice as long as the path to the nearest leaf. This logarithmic height guarantee ensures that basic operations like search, insert, and delete remain efficient even in the worst-case scenario. A helpful way to remember this formula is that the '2' represents the maximum possible imbalance allowed by the red-black coloring rules.

Also asked as:
  • In a Red-Black Tree with n internal nodes, what is the upper bound on its height, using a base-2 logarithm?

Would you remember this in 6 months?

Trivia Forge uses spaced repetition so facts stick. Free, no signup needed.

Turn on Algorithms practice →

More Algorithms trivia

See all 83 →