Skip to content

Commit b0608a0

Browse files
sarvjeetdevcclauss
andauthored
Update other/majority_vote_algorithm.py
Co-authored-by: Christian Clauss <cclauss@me.com>
1 parent 88efe5b commit b0608a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

other/majority_vote_algorithm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import collections
22

33
"""
4-
This is Booyer-Moore Majority Vote Algorithm. The problem statement goes like Given an integer array of size n, find all elements that appear more than ⌊ n/k ⌋ times.
4+
This is Booyer-Moore Majority Vote Algorithm. The problem statement goes like:
5+
Given an integer array of size n, find all elements that appear more than ⌊ n/k ⌋ times.
56
We have to solve in O(n) time and O(1) Space.
67
URL : https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_majority_vote_algorithm
78

0 commit comments

Comments
 (0)