Linear Time Selection

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Oct 12 6:24
Editor
Edited
Edited
2023 Oct 12 6:35
Refs
Refs

Due to Blum, Floyd, Pratt, Rivest and Tarjan [1973]

There is linear time worst case algorithm. The idea is generating a good pivot recursively which drop worst cases of
Randomized selection
by rote means by brute-force method
by rote means by brute-force method
  1. Divide the elements into groups of and find the median of each -element group by rote.
  1. Recursively select the median of the group medians to be the pivot
  1. Partition around the pivot . Let .
  1. If then return x
    1. else if
      then recursively select the th smallest element in the lower part
      else recursively select the th smallest element in the upper part
 

Abstraction

  • For , worst-case time is
 
 
 
 
 

Recommendations