Assume that we are given \'n\' objects and a subroutine that takes two inputs and says if they are equivalent or not (e.g. it can give output as 1 if they are equal).
<
You can use the Boyer-Moore majority voting algorithm, which does at most n-1 comparisons.
function find_majority(A)
majority = None
count = 0
for a in A:
if count == 0
majority = a
else if a == majority
count += 1
else
count -= 1
return majority
It returns the most common element if appears more than n/2 times in the array.
If you need to know if there is a majority item, then you can make a second pass through the array counting how many times the value returned from the find_majority function appears. This adds another n comparisons.