considering n>>k

pop the element k times;
for every pop we will save the swaps we have done in array(swap here means
when we put the last element in the top of array and bubble down the heap
then swaps at that time);
now after finding kth smallest simply back track using path saved in th
eprevious step

time complexity : O(KlogN)
space complexity : O(KlogN)

any better solution or idea to minmize the space

-- 
Regards
Jitendra Kushwaha
MNNIT, Allahabad

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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