Order_statistics

# Order_statistics - Medians and Order Statistics...

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

1 Medians and Order Statistics CLRS Chapter 9

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

View Full Document
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
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

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

View Full Document
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!)
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.

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

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

## This note was uploaded on 10/02/2011 for the course CS 7300 taught by Professor R during the Spring '11 term at LSU.

### 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
Ask a homework question - tutors are online