A balanced binary tree keeps its branches sufficiently even. In a binary search tree, smaller keys go left and larger keys go right, so each comparison can discard roughly half the remaining nodes. section 7.2.1
Searching a map
For nodes {1:a}, {3:c}, and {5:e}, placing {3:c} at the top keeps the tree balanced. Searching for {2:b} compares with 3, moves left to 1, and stops. Search, insertion, and removal remain O(log(n)); an unbalanced chain can make searching much slower. section 7.2.1
Figure 7.2 Three elements in a balanced binary search tree: nodes with smaller keys go on the left and larger keys on the right.
View the three-node layout showing smaller keys on the left and larger keys on the right. section 7.2.1
Figure 7.3 Constant time complexity: O(n) grows much faster than logarithmic complexity, O(log(n)), as the number of elements is increased.
Compare how logarithmic growth scales against linear growth as the number of elements increases. section 7.2.1
