how about bucket sort ? with may be bucket size=100 //if max marks=100
Mohit On Sat, Dec 25, 2010 at 6:59 PM, punnu <[email protected]> wrote: > There are N students in a class. They got marks in a certain test. > Teacher decides to give prize1 to top log(n) students and the next > sqrt(n) students be given prize2. However, he has stipulated that we > cannot sort the student roll list according to marks (which would take > O(nlog(n)) time) but should use something to get the answer in O(n) > time. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
