Counting sort algorithm

In this algorithm time complexities is O(Range).But sir said O(N+Range).No of elements in arrays is always less than or equal to range .it not exceed range then time is O(range )

@asif_h it is because firstly we fill the frequency array which take O(N) time and then printing sorted array will take O(range) . that is why total will take O(N+range).

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.