next up previous
Next: Selection in Expected Linear Up: l4 Previous: Medians and Order Statistics

Min and Max

Min(A):
O(n) (n-1 comparisons)
Max(A):
O(n) (n-1 comparisons)
Both:
O(n) (2(n-1) comparisons)


next up previous
Next: Selection in Expected Linear Up: l4 Previous: Medians and Order Statistics