QuickSort

6 07 2008

QuickSort. It’s widely accepted as the fastest generic sorting algorithm around. It’s also very simple. A comment in the last article showed me this Haskell beauty:

qsort []     = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)

While my C implementations aren’t any where as beautiful, I’m quite satified with their efficiencies. I’ll keep the code to a minimum, and the let the graphs do the talking.

Read the rest of this entry »

Advertisements