Suppose that each person in a group of n people votes for exactly two people from a slate of candidates to fill two positions on a committee.The top two finishers both win positions as long as each receives more than n/2 votes.
a) Devise a divide-and-conquer algorithm that determines whether the two candidates who received the most votes each received at least n/2 votes and, if so, determine who these two candidates are.
b) Use the master theorem to give a big-O estimate for the number of comparisons needed by the algorithm you devised in part (a).