Boyer–Moore majority vote algorithm
Low-space search for a majority element
The Boyer–Moore majority vote algorithm is an algorithm for finding the majority of a sequence of elements using linear time and a constant number of words of memory. It is named after Robert S. Boyer and J Strother Moore, who published it in 1981, and is a prototypical example of a streaming algorithm.
Nº Q18814414 ★
Common · Knowledge
Boyer–Moore majority vote algorithm
Low-space search for a majority element
The Boyer–Moore majority vote algorithm is an algorithm for finding the majority of a sequence of elements using linear time and a constant number of words of memory. It is named after Robert S. Boyer and J Strother Moore, who published it in 1981, and is a prototypical example of a streaming algorithm.
From Wikipedia
The Boyer–Moore majority vote algorithm is an algorithm for finding the majority of a sequence of elements using linear time and a constant number of words of memory. It is named after Robert S. Boyer and J Strother Moore, who published it in 1981, and is a prototypical example of a streaming algorithm. In its simplest form, the algorithm finds a majority element, if there is one: that is, an element that occurs repeatedly for more than half of the elements of the input. A version of the algorithm that makes a second pass through the data can be used to verify that the element found in the first pass really is a majority. If a second pass is not performed and there is no majority, the algorithm will not detect that no majority exists. In the case that no strict majority exists, the returned element can be arbitrary; it is not guaranteed to be the element that occurs most often (the mode of the sequence). It is not possible for a streaming algorithm to find the most frequent element in less than linear space, for sequences whose number of repetitions can be small.
Text: Wikipédia, CC BY-SA 4.0. · Image: David Eppstein (CC0) ·
Related cards
-
B
Boyer–Moore string-search algorithm
String searching algorithm
Nº Q895984 ★
Not listed
-
Borůvka's algorithm
Algorithm for finding minimum spanning trees by repeatedly finding the shortest edge out of each subtree in a forest and adding all such edges to the forest
Nº Q1468211 ★
Not listed
-
Grover's algorithm
Quantum unstructured search algorithm that finds with high probability the unique input to a black box function that produces a particular output value using 𝑂(𝑁) evaluations
Nº Q1028292 ★★
Not listed
-
M
Möller–Trumbore intersection algorithm
Method of calculating ray-triangle intersections in 3D space
Nº Q17133310 ★
Not listed
-
Quickselect
Selection algorithm to find the kth smallest element in an unordered list
Nº Q3927837 ★
Not listed
-
Quicksort
Divide and conquer sorting algorithm
Nº Q486598 ★★★★
Not listed