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:
“Truth of a modest sort I can promise you, and also sincerity. That complete, praiseworthy sincerity which, while it delivers one into the hands of ones enemies, is as likely as not to embroil one with ones friends.”
—Joseph Conrad (18571924)