How to do bubble sort in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to do bubble sort in java?

16th Jun 2018, 6:41 PM
Aahnik Daw
Aahnik Daw - avatar
3 Answers
+ 2
In addition, you should define two for loop, first starts from the beginning and the second starts from the second index. I mean for example: i=1 and j=i+1; And then you can check which one is greater or smaller then change the order.
16th Jun 2018, 6:46 PM
Mohammadyar Barandov
Mohammadyar Barandov - avatar
17th Jun 2018, 9:22 AM
hinanawi
hinanawi - avatar
+ 1
https://www.sololearn.com/learn/649/?ref=app
16th Jun 2018, 6:43 PM
Sad
Sad - avatar