next up previous
Next: Up: Previous:

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: Up: Previous: