The STL provides several algorithms to sort elements of a range. In addition to full sorting, the STL
provides variants of partial sorting. If their result is enough, you should prefer them because they
usually have better performance.
Because (forward) lists and associative and unordered containers provide no random-access iterators,
you can’t use these containers (as a destination) for sorting algorithms. Instead, you might
use associative containers to have elements sorted automatically. Note, however, that sorting all
elements once is usually faster than keeping them always sorted (see Section 7.12, page 394, for
details).