Function radix_counting_sort

Function Documentation

status_t radix_counting_sort(size_t *arr, size_t *tmp, size_t n_elts, size_t digit, size_t base)

Sort an array of non-negative ints via counting sort, as part of radix sort.

Parameters:
  • arr – The array to sort

  • tmp – Temporary array to hold elements as they are sorted. Must be at least as large as arr.

  • n_elts – # elements in arr and tmp.

  • digit – Current digit being processed.

  • base – The base of the numbers to be sorted; must be <= 16.

Returns:

status_t