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

Boyer Moore majority vote Algorithm in c++ #1730

Merged
merged 7 commits into from
Dec 30, 2020

Conversation

rutujadhanawade
Copy link
Contributor

@rutujadhanawade rutujadhanawade commented Dec 27, 2020

Have you read the Contributing Guidelines on Pull Requests?

yes

Description

Boyer Moore Algorithm in c++

Checklist

  • I've read the contribution guidelines.
  • I've checked the issue list before deciding what to submit.
  • I've edited the README.md and link to my code.

Related Issues or Pull Requests

#1439

@rutujadhanawade
Copy link
Contributor Author

@iamrajiv Please review this

Copy link
Contributor

@atarax665 atarax665 left a 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.

Copy link
Contributor

@iamrajiv iamrajiv left a 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.

@rutujadhanawade
Copy link
Contributor Author

rutujadhanawade commented Dec 28, 2020

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.

@atarax665
Copy link
Contributor

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.

Copy link
Contributor

@vatsalkesarwani12 vatsalkesarwani12 left a comment

Choose a reason for hiding this comment

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

👍🏻

@rutujadhanawade
Copy link
Contributor Author

Thank you to let us know about this error.

I would like to solve this error , Can I create a new issue for this?

@iamrajiv iamrajiv merged commit e82cbc5 into HarshCasper:master Dec 30, 2020
@ankitaggarwal23 ankitaggarwal23 changed the title majority vote algorithm in c++ Boyer Moore Algorithm in c++ Apr 22, 2021
@ankitaggarwal23 ankitaggarwal23 changed the title Boyer Moore Algorithm in c++ Boyer Moore majority vote Algorithm in c++ Apr 22, 2021
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.

4 participants