How do i write a method which sorts a given array by applying the Bubble Sort algorithm, i.e. linearly comparing neighbouring elements and swap them as necessary until the array is sorted. But the given array does not contain elements of type int but contain arbitrary objects (i.e. any object of classes implementing the Comparable interface).
2 Replies - 241 Views - Last Post: 28 March 2012 - 05:44 PM
Replies To: sorting a given array by applying the Bubble Sort algorithm
Re: sorting a given array by applying the Bubble Sort algorithm
Posted 28 March 2012 - 03:00 AM
We don't write methods for you. Try searching around on Google for a method on how to do it (I'm sure there is at least one of them out there), then modify it for how you want it, then, if all else fails after that, post back here.
Page 1 of 1