Algorithm to find majority element
Let A be an array of n elements. An element x is said to be a majority element in A if it occurs in A more than n/2 times. Assume that the only comparisons allowed between elements are tests of equality. Give an algorithm that uses no more than 2n comparisons to determine whether the array A contains a majority element and, if so, find it.
By OTA: Xiao Liu, MS
OTA Rating: 4.7/5
Your Price: $2.19 (original value ~$11.97)
What's included:
Page generated in 0.0142 seconds