Function to get the largest element from an array
| 5 | |
| 6 | // Function to get the largest element from an array |
| 7 | int getMax(int array[], int n) { |
| 8 | int max = array[0]; |
| 9 | for (int i = 1; i < n; i++) |
| 10 | if (array[i] > max) |
| 11 | max = array[i]; |
| 12 | return max; |
| 13 | } |
| 14 | |
| 15 | // Using counting sort to sort the elements in the basis of significant places |
| 16 | void countingSort(int array[], int size, int place) { |