Algorithms Flashcards

1
Q

Quicksort

A
quicksort :: Ord a => [a] -> [a]
quicksort []     = []
quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater)
    where
        lesser  = filter (< p) xs
        greater = filter (>= p) xs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly