MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / radixsort

Function radixsort

CPP/sorting/radix_sort.cpp:43–50  ·  view source on GitHub ↗

Main function to implement radix sort

Source from the content-addressed store, hash-verified

41
42// Main function to implement radix sort
43void radixsort(int array[], int size) {
44 // Get maximum element
45 int max = getMax(array, size);
46
47 // Apply counting sort to sort elements based on place value.
48 for (int place = 1; max / place > 0; place *= 10)
49 countingSort(array, size, place);
50}
51
52// Print an array
53void printArray(int array[], int size) {

Callers 1

mainFunction · 0.85

Calls 2

getMaxFunction · 0.85
countingSortFunction · 0.85

Tested by

no test coverage detected