Self-balancing trees fix the degenerate-BST problem by keeping height O(log n) guaranteed — which is why Java's TreeMap, C++'s std::map, and every ordered set in the standard library runs on one under the hood.
#trees#binary-search-trees#balanced-trees
13 min