Java runs on pretty much anything it wants to...
I went back to the mergeSort alogrithms which is from the Microsystems and I found that mergeSort implemented a superclass that contained a method called "pause", and when I traced the pause back to the superclass and found that there was a Thread.sleep(20); line within the pause() method. I know that merge sort is one of the fastest sorter when it comes to large list but when I tested it on my machine, it just lagged like shit. So, I removed the thread and now..it runs like a beauty...
Just strange to see that Microsystem is even using Thread.sleep() line within a mergeSort...
While we're on the top of sorting alogrithms, I was messing around with Shell Sort and I noticed that as you increase the increments, the sorter is faster and so I just had the increment to match with the length of the array/vector and it runs at the fastest. So..just a tip for those of you who use a shell sort. Have the increment match the length of array or vector.
__________________
Looking out the window, that's an act of war. Staring at my shoes, that's an act of war. Committing an act of war? Oh you better believe that's an act of war
|