0
I need help with my code on sorting an string array (manually)
I've already figured it out how to sort it. But my problem is my code only sort the first letter for example Input : cst bat ant cat Output : ant bat cst cat I want it to ouput: ant bat cat cst. https://code.sololearn.com/cEdMShi37ced/?ref=app
6 Answers
+ 3
Maybe this helps you:
https://www.sololearn.com/learn/651/?ref=app
+ 2
The general lesson about bubble sort:
https://www.sololearn.com/learn/649/?ref=app
Yes, it works also with Strings.
instead of > you can use .compareTo()
+ 1
Use comparesTo method or use another loop.. And instead of charAt(0), use like charAt(i) but it takes some more changes...
+ 1
Thankk you so much :))
0
Thanks :). I will try it.
0
Thank you. Does it work with strings? :)