There are two approaches. The first one is suitable for the condition that the majority is more than or equal to n/2. The second one is suitable for the more than n/2. Approach 1: In the procedure findelement, it will choose an element with the most possibility and then prove it that it is the [...]
Posts Tagged ‘majority’
Find a majority element problem
Posted in Tech, tagged majority on March 6, 2010 | Leave a Comment »