please send the solution of counting sort so that i can understand it
Did not understand counting sort
Hey @harryson count sort works as follows:-
You take a frequency array of the size of your max possible Number and initialize it with 0.
Now as you take input of a number you increase frequency of that number in your frequency array.
In the next step you are supposed to iterate over your frequency array and print a particular number as many times as its frequency in the frequency array, i.e., if for a particular ‘i’ frequency is F(i) then you need to print i F(i) times, or in other words ‘i’ occurs F(i) times in your array.
Hope this clears your doubt as to how the count sort works but if you still have any further queries please feel free to ask.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.