Link to home
Start Free TrialLog in
Avatar of jigdog
jigdogFlag for United States of America

asked on

Java Bubble Sort of String Array?

Anyone have a nice clean implementation of this?  I have the loop logic, just running into trouble when the comparing rolls around.
Avatar of Mick Barry
Mick Barry
Flag of Australia image

some examples here

http://www.leepoint.net/notes-java/data/arrays/32arraybubblesort.html

for comparing strings instead of ints just use compareTo() method
         Hi!

Here is an BubbleSort example (using array of long) but can easily be converted for Strings.
http://www.java2s.com/Code/Java/Collections-Data-Structure/Bubblesort.htm

Regards,
    Tomas Helgi
ASKER CERTIFIED SOLUTION
Avatar of SprudeVI
SprudeVI
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial