Sort (C++)

Sort (C++)

sort is a function in C++ Standard Library that takes two random-access iterators, the start and the end, as arguments and performs a comparison sort on the range of elements between the two iterators, front-inclusive and end-exclusive. The specific sorting algorithm is not mandated and may vary across implementations. The GNU Standard C++ library, for example, uses a hybrid sorting algorithm: introsort is performed first, to a maximum depth given by 2×log2 n, where n is the number of elements, followed by an insertion sort on the result. Whatever the implementation, the complexity should be O(nlogn) comparisons on the average.

Read more about Sort (C++):  Usage, Other Types of Sorting, Comparison To Qsort, See Also, External Links

Famous quotes containing the word sort:

    It was a time of madness, the sort of mad-hysteria that always presages war. There seems to be nothing left but war—when any population in any sort of a nation gets violently angry, civilization falls down and religion forsakes its hold on the consciences of human kind in such times of public madness.
    Rebecca Latimer Felton (1835–1930)