View Single Post
  #2 (permalink)  
Old 01-25-2008, 02:05 AM
gibsonrocker800's Avatar
gibsonrocker800 gibsonrocker800 is offline
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
I think you should learn about other sorts. I personally have never used BubbleSort, but I have used others like SelectionSort, InsertionSort, QuickSort and MergeSort. I recommend MergeSort. It's pretty cool once you understand how it works. Basically, it splits up the data in half, and does it over and over again through recursion, and then sorts the simplest set. Here:

2 4 5 1 9 3 8 7
__________________________
2 4 5 1 | 9 3 8 7
__________________________
2 4 | 5 1 | 9 3 | 8 7|
_________________________
Now, sort each part
__________________________
2 4 | 1 5 | 3 9 | 7 8 |

etc.



Maybe you already know about MergeSort, and my reply doesn't really help you with your problem, so I'm sorry if that's the case.
__________________
//Haha javac, can't see me now, can ya?
Reply With Quote