Loading topic
0..k, you can use a key directly as an array index. This chapter turns that idea into the simplest working version of coun5 min readkey argument, know Big-O notation, and have seen at least one comparison sort. It also assumes you have read the previous chapter, which covered the histogram version of counting sort.5 min readcounting_sort_by_key. It also assumes you can read Big-O notation and know that comparison sorts such as merge sort take O(n log n) time. Here we count exactly what counting sort spends7 min readk is small. A 32-bit integer can take about four billion values, so one counting sort over the full key would need a count array with four billion entries. LSD radix sort avoids that. It sorts on one small digit at a time, starting with the least signi6 min readcounting_sort_by_key and radix_sort_lsd from those cha7 min readsorted() (Timsort)7 min read