You can use Radix Sort.
It will have a Time Complexity of O(n).

On Saturday, May 5, 2012 12:17:15 AM UTC+5:30, Algobiz wrote:
>
> How to sort n numbers in the range of 1 to n^2 in O(n).. Any ideas?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/OLTTwzx8f9MJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to