The nth_element() algorithms are provided if you need only the nth sorted element or the set of the n highest or n lowest elements (not sorted). Thus, nth_element() is a way to split elements into two subsets according to a sorting criterion. However, you could also use partition() or stable_partition() to do this. The differences are as follows