Where can I use a technique from Majority Vote algorithm

As seen in the answers to Linear time majority algorithm?, it is possible to compute the majority of an array of elements in linear time and log(n) space.

It was shown that everyone who sees this algorithm believes that it is a cool technique. But does the idea generalize to new algorithms?

It seems the hidden power of this algorithm is in keeping a counter that plays a complex role -- such as "(count of majority element so far) - (count of second majority so far)". Are there other algorithms based on the same idea?

6
задан Community 23 May 2017 в 11:45
поделиться