Explain the below code step by stepspecifying what each line means and does. quicksort :: (Ord a)
Fantastic news! We've Found the answer you've been seeking!
Question:
Explain the below code step by stepspecifying what each line means and does.
quicksort :: (Ord a) => [a] -> [a]
quicksort [] =[]
quicksort (x:xs) =
let smallerSorted = quicksort [a | a <- xs, a <= x]
biggerSorted = quicksort [ a | a <- xs, a > x]
in smallerSorted ++ [x] ++ biggerSorted
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: