not able to understand the error
Countingsort1234
Hello,
Why are you applying merge sort for the question of counting sort?
Steps:
-
Just make an array “freq” of size “max” (i.e the maximum element of input array).
-
Then, count the occurances of elements in the freq array using element of input array as index.
-
At last print the elements in sorted order using this freq array.
Hint: the index of freq array represents the elements of input array.
Hope, this would help.
Give a like if you are satisfied.