Selection Algorithm/Problem

Find the kth smallest item in an array of distinct numbers.

Solutions:

  1. Make passes through the array, deleting the minimum number each time
  2. Sort , then return
  3. Scan the array and maintain the smallest numbers seen so far in a max-heap
  4. Create a min-heap with [Heapify]. Call deleteMin(A) times

Questions

  • Which of the following options correctly represents the selection problem?
    • Given an array of size  and an integer , a solution to the selection problem returns the item that would be at index in the sorted array.