Apr 18, 2026
Which self-balancing binary search tree uses 'color' properties on nodes — red or black — to ensure the tree remains approximately balanced after insertions and deletions?
Skipped
Answer
Red-Black Tree. A Red-Black Tree enforces balance through five invariants, including that every path from root to a null leaf has the same number of black nodes. This guarantees O(log n) worst-case time for search, insert, and delete. It is the underlying structure used in Java's TreeMap and C++ STL's std::map.