Skip to content
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

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mrinalchauhan
Copy link

The Boyer-Moore voting algorithm is one of the popular optimal algorithms which is used to find the majority element among the given elements that have more than N/ 2 occurrences. This works perfectly fine for finding the majority element which takes 2 traversals over the given elements, which works in O(N) time complexity and O(1) space complexity.

@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.79%. Comparing base (55ff0ad) to head (1951f32).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1750      +/-   ##
==========================================
+ Coverage   84.76%   84.79%   +0.02%     
==========================================
  Files         378      379       +1     
  Lines       19738    19770      +32     
  Branches     2957     2962       +5     
==========================================
+ Hits        16731    16763      +32     
  Misses       3007     3007              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also get rid of the unrelated changes to package[-lock].json. Otherwise this looks fine.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Maths/MobiusFunction.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid there are still unrelated changes in this PR. Essentially all changes that aren't to MooreVotingAlgorithm.* should not be in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants