We can use Median of medians 

http://en.wikipedia.org/wiki/Selection_algorithm#Linear_general_selection_algorithm_-_Median_of_Medians_algorithm


On Sunday, 17 June 2012 08:13:18 UTC+5:30, Prem Nagarajan wrote:
>
> Give an array of unsorted elements, find the kth smallest element in the 
> array.
>
> The expected time complexity is O(n) and no extra memory space should be 
> used.
>
> Quickselect algorithm can be used to obtain the solution. Can anyone 
> explain how quickselect works?
>

-- 
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/-/4lQsacmUPYUJ.
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