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
#1
sorting a given array by applying the Bubble Sort algorithm
Posted 28 March 2012 - 01:18 AM
Replies To: sorting a given array by applying the Bubble Sort algorithm
#2
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.
#3
Re: sorting a given array by applying the Bubble Sort algorithm
Posted 28 March 2012 - 05:44 PM
Our Tutorial section and the Code Snippets section are full of examples of sorts of all sorts
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|