Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.


Standard Template Library Sort Algorithms

C++ STL sort algorithms.

Radix Sort

A type of algorithm that sorts based upon distribution instead of by comparison. Wikipedia has an article about Radix Sorting. A more detailed description of various Radix Sorting algorithms is provided here:

Donald Knuth. The Art of Computer Programming, Volume 3: Sorting and Searching, Second Edition. Addison-Wesley, 1998. ISBN 0-201-89685-0. Section 5.2.5: Sorting by Distribution, pp.168-179.


A high-speed comparison-based sorting algorithm that takes 𝑶(N * log(N)) time. See introsort and Musser, David R. (1997). "Introspective Sorting and Selection Algorithms", Software: Practice and Experience (Wiley) 27 (8), pp 983-993, available at Musser Introsort.

American Flag Sort

A high-speed hybrid string sorting algorithm that string_sort is partially based upon. See American flag sort and Peter M. McIlroy, Keith Bostic, M. Douglas McIlroy. Engineering Radix Sort, Computing Systems 1993.

Adaptive Left Radix (ARL)

ARL (Adaptive Left Radix) is a hybrid cache-friendly integer sorting algorithm with comparable speed on random data to integer_sort, but does not have the optimizations for worst-case performance, causing it to perform poorly on certain types of unevenly distributed data.

Arne Maus, ARL, a faster in-place, cache friendly sorting algorithm, presented at NIK2002, Norwegian Informatics Conference, Kongsberg, 2002. Tapir, ISBN 82-91116-45-8.

Original Spreadsort

The algorithm that integer_sort was originally based on. integer_sort uses a smaller number of key bits at a time for better cache efficiency than the method described in the paper. The importance of cache efficiency grew as CPU clock speeds increased while main memory latency stagnated. See Steven J. Ross, The Spreadsort High-performance General-case Sorting Algorithm, Parallel and Distributed Processing Techniques and Applications, Volume 3, pp.1100-1106. Las Vegas Nevada. 2002. See Steven Ross spreadsort_2002.