STL
In this lesson, we'll learn about the C++ STL sorting library and how to leverage it to perform custom sorting.
We'll cover the following...
We'll cover the following...
C++ STL
Here’s what we will be doing when we have to sort an array or vector.
Array
Vector #
The actual sorting algorithm used will depend on the language but these are generally faster sorting algorithms of the order .
Custom comparator
The sort function sorts the integers in non-decreasing order. For other data types, default comparison is used. For example:
float- same asint.pair<first, second>- the first part of the pair is compared first. If they are the same, then the second part is compared.