{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Order_Statistics_I_Dorr-351-Oct09-2007

# Order_Statistics_I_Dorr-351-Oct09-2007 - Simply stated...

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

Simply stated: “Given a list of n unique values, find the i th smallest.” Common Examples 1 st smallest (Minimum) n th smallest (Maximum) n/2 th smallest (Median) How can we approach solving such problems? Trivial Way: Sort the list and then return the i th position. This is clearly not a good approach for things such as minimum and maximum. This may or may not be a good approach for other problems such as median finding.

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

View Full Document
In the worst case, finding the minimum requires n- 1 comparisons. Finding the minimum can easily be done using at worst n-1 comparisons: Call the first item in the list the smallest. For each item remaining, compare it to the item currently considered smallest and if it is smaller than that item, set this new item as the smallest. Do other algorithms exist? Sure, but are they better? What would the runtime be of the following recursive algorithm? Split the list in half.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 6

Order_Statistics_I_Dorr-351-Oct09-2007 - Simply stated...

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

View Full Document
Ask a homework question - tutors are online