Logarithmic time complexity describes work that grows with the logarithm of the number of elements, commonly written O(log(n)). A balanced binary search tree reaches a target by choosing only one branch at each comparison, so doubling the elements requires only about one additional set of comparisons. section 7.2.1
Searching a map
To find key 2 in a balanced tree containing 1, 3, and 5, begin at 3, move left to 1, and stop when the search path ends. An std::map commonly uses this structure, giving search, insertion, and removal logarithmic complexity. By contrast, searching a vector is O(n): in the worst case, every element must be checked. section 7.2.1 section 7.4
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.
See how smaller keys occupy the left branch and larger keys the right branch in a balanced binary search tree. section 7.2.1



