+ 1

why this code is not working (bubble sort using class)

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

1st Feb 2020, 4:46 AM
Jagbir singh
Jagbir singh - avatar
5 Respuestas
+ 1
In inner for loop, it should be j<(n-i-1)
1st Feb 2020, 6:42 AM
Avinesh
Avinesh - avatar
+ 2
Yup, working for me too. No errors found when ran your code.
1st Feb 2020, 5:10 AM
D Shah 🎯⏳️
D Shah 🎯⏳️ - avatar
+ 1
for input 9 to 1 it gives output 1023456789
1st Feb 2020, 5:58 AM
Jagbir singh
Jagbir singh - avatar
+ 1
Start your loop by 1 not by 0.. nd see the magic 😏 https://code.sololearn.com/c6985EEgt4Gj/?ref=app
1st Feb 2020, 1:11 PM
Anmol Kumar
Anmol Kumar - avatar
0
Where do you find the error or for what inputs it doesn't work? I ran it once and it worked.
1st Feb 2020, 5:08 AM
Avinesh
Avinesh - avatar