Question: More formally, you are given an array X[1..n]. The only method you have to compare elements of X is a procedure Same(x, y) that returns
More formally, you are given an array X[1..n]. The only method you have to compare elements of X is a procedure Same(x, y) that returns True if elements x and y are equivalent and False otherwise. Design and analyze an algorithm to output a member of X whose equivalence class contains strictly greater than n/2 members. For your analysis, give an asymptotic bound on the number of times your algorithm calls Same. Note: Expressing the number of calls to Same as a recurrence is worth substantial partial credit, but you should be able to give an asymptotically tight answer by now.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
