What am I doing wrong in this bubble sorter? | Sololearn: Learn to code for FREE!

+1

What am I doing wrong in this bubble sorter?

https://code.sololearn.com/c2zqQLZU4T1U/?ref=app

8/7/2022 5:16:21 PM

Nemanja Jović

1 Answer

New Answer

+3

You have moved your biggest value to the last place, but thats it. You could use 2 loops, 1 for the places you want to fill, and the other for the comparisons until the biggest of the remaining numbers have been sorted to the desired position