Monday, September 15, 2008

And now for another exciting episode of "What the fuck is Casey talking about?"

I just wrote the best quicksort in the history of time! Who cares that it can only exist in a highly inefficient garbage collected system with so much crazy hand-waving that we can only cross our fingers and silently entreat god that our nice Θ(n log n) algorithm is not overwhelmed by the torrential flood of fall-of-Rome-style extravagance in which we are awash!
import List

quicksort (pivot : rest) = quicksort lessThan ++ [pivot] ++ quicksort atLeast
where
(lessThan, atLeast) = partition (< pivot) rest
quicksort [] = []

1 comment:

Anonymous said...

My favorite show!