jigdog
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.
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.leepoint.net/notes-java/data/arrays/32arraybubblesort.html
for comparing strings instead of ints just use compareTo() method