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

bubble sort is wrong #89

Open
deguilardi opened this issue Oct 13, 2019 · 4 comments
Open

bubble sort is wrong #89

deguilardi opened this issue Oct 13, 2019 · 4 comments

Comments

@deguilardi
Copy link

bubble sort is wrong, the time complexity is always n^2

@diptangsu
Copy link
Owner

Can you please link the file saying which code is wrong? Is it wrong in all languages? You can open a PR after making a fix.

@deguilardi
Copy link
Author

The bubble sort is wrong in every language. The time complexity of your code is always n^2, the best case should be n. There is an optimization missing.

arathyrose added a commit to arathyrose/Sorting-Algorithms that referenced this issue Oct 31, 2019
…the inner loop does not swap any element
arathyrose added a commit to arathyrose/Sorting-Algorithms that referenced this issue Oct 31, 2019
…f the inner loop does not swap any element
@arathyrose
Copy link
Contributor

Fixed this issue in C (commit ID: 84445fe) and C++ (commit ID: c9bd2d6)

diptangsu added a commit that referenced this issue Nov 3, 2019
diptangsu added a commit that referenced this issue Nov 3, 2019
@wassim31
Copy link
Contributor

wassim31 commented Jul 29, 2021

I developed the code to be more clear.
This is my commit : 44f3b5a

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

No branches or pull requests

4 participants