The sort() algorithm sorts the elements in the range [start, finish) in ascending order using either operator<() or the function object comp. The algorithm is not stable; that is, it does not preserve the order of elements that are equivalent (i.e., those for which (a < b && b < a) == false). If maintaining such an ordering is is important, stable_sort() should be used instead. sort() is implemented using introsort.