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:

    Ah, I fancy it is just the same with most of what you call your “emancipation.” You have read yourself into a number of new ideas and opinions. You have got a sort of smattering of recent discoveries in various fields—discoveries that seem to overthrow certain principles which have hitherto been held impregnable and unassailable. But all this has only been a matter of intellect, Miss West—superficial acquisition. It has not passed into your blood.
    Henrik Ibsen (1828–1906)