How to solve this?
Let S = {x1,x2,…,xn} be a set of n positive integers. We wantto find an element x that is in the upper half when S is sorted, orin other words greater than the median. Give a randomized algorithmto solve this problem with probability 1 − 1/n. Compare thisalgorithm with a deterministic algorithm for large values of n, saymore than a million.
Expert Answer
Answer to How to solve this? Let S = {x1,x2,…,xn} be a set of n positive integers. We want to find an element x that is in the u…