Average
Input: array A of n numbers
Output: the average of the n numbers (sum divided by n)
Max
Input: array A of n numbers
Result: A is permuted so that A1 ≤ Ai, for all i.
Min
Input: array A of n numbers
Result: A is permuted so that An ≥ Ai, for all i.
MaxMin
Input: array A of n numbers
Result: A is permuted so that A1 ≤ Ai ≤ An, for all i.
Sort
Input: array A of n numbers
Result: A is permuted so that Ai ≤ Ai+1, for i = 1,2,...,n-1.
Median
Input: array A of n numbers
Output: element x of A such that, if A were sorted, x = A⌈n/2⌉.
Select
Input: array A of n numbers and number k in 1..n
Output: element x of A such that, if A were sorted, x = Ak.
Equal Partition (subset sums to half)
Input: array A of n numbers
Output: true if and only if there is a subset of the entries whose sum is
(1/2)Σni=1 Ai.
Largest Increasing Sequence
Input: array A of n numbers
Output: length of a largest increasing subsequence of A (not necessarily adjacent).
Example: For A = (3,1,4,1,5,9,2,6,5,3,5), output is 4.
Which is hardest? Which is easiest? How should we measure hard and easy? How do we analyze and quantify correctness and performance of a solution (an algorithm)? Can we prove a solution is best possible?