CS230 - Assignment 3.2
- Consider the problem of finding the median of three orderable elements
A, B, and C
- Design an optimal algorithm to find the median.
- Assuming that each input permutation is equally likely, how many
comparisons does your algorithm take on average?
- Use posets to show that your algorithm has optimal worst cost.
- Consider the input list 1 8 7 5 4 1 3 6
- Show the Binomial Tree which would be constructed by the
BuildBinomialTree algorithm.
- Which element in the tree are candidates for 2nd Max?
- Consider the problem of determining if at least three of five integer
values are non-zero using only the operation of testing equality with zero.
Give an adversary strategy to force ANY algorithm to examine all of the five
values.