-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Boyer Moore majority vote Algorithm in c++ #1730
Conversation
@iamrajiv Please review this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not Boyer–Moore majority vote algorithm, this is the general algorithm to find majority element in an array. Please do check your algorithm once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rutujadhanawade In Boyer–Moore majority vote algorithm the time complexity is linear but according to your code it is of quadratic time.
I took referance from the code present in java folder https://github.com/TesseractCoding/NeoAlgo/blob/master/Java/Algorithms/Moore_Algorithm.java complexity of this algorithm is also not linear. Now I have made all the changes in my code. Please review. |
Thank you to let us know about this error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
I would like to solve this error , Can I create a new issue for this? |
Have you read the Contributing Guidelines on Pull Requests?
yes
Description
Boyer Moore Algorithm in c++
Checklist
README.md
and link to my code.Related Issues or Pull Requests
#1439