{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full Document Right Arrow Icon
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.
Background image of page 2
Image of page 3
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 Right Arrow Icon bookmark
Ask a homework question - tutors are online