Solved

# Algorithm right?

Posted on 2003-12-06

I need to write for the program that computes A th smallest number in a set of K distinct integer. But there's an restriction that the running time has to be

O(K+Alog(K)). This is my way of thinking. I think I will need to sort the data first. And I'm think to use basket sorting. Then find the number I want. I just want to know if it is right? Or I should use heap sort? I'll appreciate any idea. I'm not asking for the actual code, I just need the algorithm so that I can start coding.

Thanks,