News for hackers. Stuff that matters.
Re:Timsort by afhof on Wednesday November 09, 2011 @04:10PM (#3217403)
While Quick Sort does have the worst case runtime of O(n^2), a proper implementation defeats this behavior almost completely. Rather than randomize the data, it would be better to randomize the algorithm (choose a random pivot). Not only is the expected runtime O(n log n) but the probability of quick sort taking even twice as long (2 * n log n) is exponentially small.
Re:Timsort by stevep98 on Thursday November 10, 2011 @03:41AM (#3219449)
Interesting. The quicksort we were using was in one of the standard JDK classes from some ancient JDK.