Countingsort1234


not able to understand the error

Hello,

Why are you applying merge sort for the question of counting sort?

Steps:

  1. Just make an array “freq” of size “max” (i.e the maximum element of input array).

  2. Then, count the occurances of elements in the freq array using element of input array as index.

  3. 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.