This is my code of sorting —>https://ide.codingblocks.com/s/360389
please correct me if i am wrong —>
1- This code complesity shuld be = o(k*n) ~= o(n)…
Then why we can use it as best sorting technique insted of nlog(n) …
This is my code of sorting —>https://ide.codingblocks.com/s/360389
please correct me if i am wrong —>
1- This code complesity shuld be = o(k*n) ~= o(n)…
Then why we can use it as best sorting technique insted of nlog(n) …
hello @kailash_01
ur code is correct. but because u r using map ,it time complexity will not be linear.
it will be o(nlogn)
assuming u are talking about standard counting sort.
it has limitation that the array size depends on the difference of max element and min element array.
if min is 1 and max is n^2 then array of n^2 size required which is too much.