Question: Given an array A of length n, we say that x is the majority element of A if x appears at least 2n/3 times in

 Given an array A of length n, we say that x

Given an array A of length n, we say that x is the majority element of A if x appears at least 2n/3 times in A. Now, Say that your array A consists of incomparable objects, where you can ask whether two objects are equal (i.e. check if A[i] A[j]), but there is NOT a notion of one object being bigger than another. In particular, we cannot sort A or find the median of A. Given such an array A of incomparable objects, write pseudocode for an agorithm that finds the majority element of A, or returns "no solution if none exists. Your algorithm should run in O(n log(n)) time. In addition to pseudocode, you should justify correctness and state the recurrence formula for the algorithm. NOTE: don't try anything silly like converting the incomparable objects to integers so that you can then sort the integers. I mean it when I say no sorting, no selection

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!