Feeds:
Posts
Comments

Posts Tagged ‘majority’

Find a majority element problem

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 [...]

Read Full Post »

Follow

Get every new post delivered to your Inbox.