At the end of the last chapter you wrote inorder traversal without recursion. You kept an array called stack, pushed every node on the way down the left side, popped one, printed it and turned right. It worked, but look at what it cost: for a chain of a million keys the stack holds a million nodes. And all the while the tree itself was carrying a pile of links that did nothing. You counted them back in the tree chapter: a tree of n nodes has n + 1 empty links, every one a NULL pointer taking up room. Could the tree use its own empty links to remember the way back up? It can, and that is the first topic of this chapter.
The second scene comes from the other end of the same story. Roll numbers are typed into a binary search tree as they are issued, 1001, 1002, 1003, and the tree grows into a chain, because every key is larger than the last. The AVL tree cures this by watching the height of every node. Real software uses other cures too. Java's TreeMap and the ordered map of C++, std::map, are red-black trees, which keep balance with a single colour bit per node. Some caches use splay trees, which keep no balance information at all and still stay fast on average. File systems and databases lean on B-trees, and the 2-3 tree is the smallest of them. This chapter shows how each of them works, and how to choose.