I may be wrong.. counting sort should be worst space complexity.. we are creating 2 extra arrays and also what will happen if k = 10000 and my input array is small like {10000, 10, 1} . In this case, we need to create auxiliary array of size 10000 initialised with zeros...