• The th order statistic of a set of elements is the th smallest element.
    • The minimum of a set is the first order statistic ()
    • The maximum of a set is the th order statistic ()
    • The median is
  • The rank of an element is its position in the linear order of the set

Problem

  • Intput: A set of (distinct) numbers and an integer , with .
  • Output: The element that is larger then exactly other elements of .

Algortihems

  • The General case:
    • takes in average case
    • takes time in the worst case
    • Using in Order-statistic tree (RB Tree with additional node field: size). takes time in the worst case.
  • Speical cases:
    • (9.1) finding min and max simultaneously in comparisons
    • (e9.1.1) finding the second smallest in comparisons