Order_statistics

Order_statistics - Medians and Order Statistics...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Medians and Order Statistics CLRS Chapter 9
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
upper median 3 4 13 14 23 27 41 lower median 54 65 75 The lower median is the -th order statistic The upper median is the -th order statistic If n is odd, lower and upper median are the same 8th order statistic 3 4 13 14 23 27 41 54 65 75 The k-th order statistic is the k -th smallest element of an array. 2 n 2 n
Background image of page 2
3 What are Order Statistics? Selecting i th -ranked item from a collection. First: i = 1 Last: i = n Median(s): i = 2 n , 2 n
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Order Statistics Overview Assume collection is unordered, otherwise trivial. find ith order stat = A[i] Can sort first –  Θ (n lg n), but can do better –  Θ (n). I can find max and min in  Θ (n) time (obvious) Can we find any order statistic in linear time?  (not  obvious!)
Background image of page 4
5 Order Statistics Overview How can we modify Quicksort to obtain expected-case   Θ (n)? ? ? Pivot, partition, but recur only on one set of data.  No join.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Using the Pivot Idea Randomized-Select(A[p. .r],i)  looking for ith o.s. if p = r
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 19

Order_statistics - Medians and Order Statistics...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online