Sorting is one of the most basic functions applied to data. It means arranging the data in a particular fashion, which can be increasing or decreasing. There is a builtin function in C++ STL by the name of sort().
Internally this function is implemented as Quick-sort. The complexity of it is O(N*log(N)).
The prototype for sort is :
sort(startaddress, endaddress) startaddress: the address of the first element of the array endaddress: the address of the next contiguous location of the last element of the array. So actually sort() sorts in the range of [startaddress,endaddress)
The outut of the above program is :
The array before sorting is : 1 5 8 9 6 7 3 4 2 0 The array after sorting is : 0 1 2 3 4 5 6 7 8 9
Refer std::sort() for more details.