Skip to content

Moore's Voting Algorithm - Boyer-Moore Majority Voting Algorithm #1750

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: added find majority element in array using Moore's Voting Algor…
…ithm
  • Loading branch information
Mrinal Chauhan committed Oct 23, 2024
commit 448415cf0c6a0fc38b6a7b8cf4d093aef2ccd10b
3 changes: 2 additions & 1 deletion Data-Structures/Array/MooreVotingAlgorithm.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ const MooreVotingAlgorithm = (arr) => {
}

return count > arr.length / 2 ? candidate : null;
};
};
export { MooreVotingAlgorithm };
Loading