Sorting-Algorithms
Sorting-Algorithms copied to clipboard
bubble sort is wrong
bubble sort is wrong, the time complexity is always n^2
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.
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.
Fixed this issue in C (commit ID: 84445fe) and C++ (commit ID: c9bd2d6)
I developed the code to be more clear. This is my commit : 44f3b5ab8be2dbac5ba57e921860b6cd8797d0cf