Finding the kth smallest element in an array

Follow Quick sort paradigm

What if k << n. Then find the first k small elements in the array by k passes. Find median in an array of elements
Median of medians is the best in choosing pivot in Quick sort

Leave a Reply

Your email address will not be published. Required fields are marked *