Algorithms and Data Structures · Middle · Question 39 of 75

What problem do self-balancing trees (AVL, red-black) solve?

Explanation

After inserts and deletes they rotate nodes to keep the tree roughly balanced. Ordered maps in many languages (Java TreeMap, C++ std::map) are red-black trees.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 39

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz