`Description`

`Description`

```
```*Nth_element* is similar to *partial_sort*, in that it partially orders a range of elements: it arranges the range *[first, last)* such that the element pointed to by the iterator *nth* is the same as the element that would be in that position if the entire range *[first, last)* had been sorted. Additionally, none of the elements in the range *[nth, last)* is less than any of the elements in the range *[first, nth)*. [1]

The two versions of *nth_element* differ in how they define whether one element is less than another. The first version compares objects using *operator<*, and the second compares objects using a function object *comp*.

The postcondition for the first version of *nth_element* is as follows. There exists no iterator *i* in the range *[first, nth)* such that **nth < *i*, and there exists no iterator *j* in the range *[nth + 1, last)* such that **j < *nth*.

The postcondition for the second version of *nth_element* is as follows. There exists no iterator *i* in the range *[first, nth)* such that *comp(*nth, *i)* is *true*, and there exists no iterator *j* in the range *[nth + 1, last)* such that *comp(*j, *nth)* is *true*.