# majority: Boyer-Moore Majority Vote Algorithm

[ algorithms, library, public-domain ] [ Propose Tags ]

The Boyer-Moore Majority Vote Algorithm determines if there in a list of votes is a candidate that holds more than half of the majority, and if so, finds this candidate. It does so in time linear in the length of the input list and constant memory. For a detailed description of the algorithm, see these papers:

• Wim H. Hesselink, "The Boyer-Moore Majority Vote Algorithm", 2005;

• Robert S. Boyer and J. Strother Moore, "MJRTY - A Fast Majority Vote Algorithm", 1982.

Versions [RSS] [faq] 1.0, 1.1 haskell2010 [details] LicenseRef-PublicDomain Nis N. Wegmann niswegmann@gmail.com Algorithms https://github.com/niswegmann/majority head: git clone https://github.com/niswegmann/majority.git by NisWegmann at 2011-07-18T15:57:23Z NixOS:1.1 1669 total (12 in the last 30 days) (no votes yet) [estimated by Bayesian average] λ λ λ Docs uploaded by userBuild status unknown

## Modules

[Index]

#### Maintainer's Corner

For package maintainers and hackage trustees

Candidates

• No Candidates

[back to package description]

# Majority

The Boyer-Moore Majority Vote Algorithm determines if there in a list of votes is a candidate that holds more than half of the majority, and if so, finds this candidate. It does so in time linear in the length of the input list and constant memory. For a detailed description of the algorithm, see these papers:

• Wim H. Hesselink, "/The Boyer-Moore Majority Vote Algorithm/", 2005;

• Robert S. Boyer and J. Strother Moore, "/MJRTY - A Fast Majority Vote Algorithm/", 1982.

## Install

Assuming you have installed the Haskell Platform use cabal:

\$ cabal install majority


## Bugs

Comments, bug reports, and patches will be much appreciated: