Answers and Comments


User Avatar
Written by CMaster


I actually myself didn't solve this puzzle, my best attempt was bucket sort, as the number of age groups is limited (no one lives longer than lets say 150 years to be sure) thus we can create 15 buckets but it only provides O(n * log(n)) solution

http://en.wikipedia.org/wiki/Bucket_sort


User Avatar
Written by didxga


this may help to solve this problem http://gafter.blogspot.com/2006/11/linear-time-sort-puzzler.html


User Avatar
Written by CMaster


Great link, thanks, Didxga !


Saved Stories

Sponsored Categories