Quickselect algorithm: Difference between revisions

m
m (→‎uses swap subroutine: added/changed comments and whitespace, used a template for the output section.)
Line 1,097:
 
main :: IO ()
main = do
print $
let v = [9, 8, 7, 6, 5, 0, 1, 2, 3, 4]
print((fmap $. (`quickselect`flip vquickselect) <$*> zipWith const [0 ..] v</lang>)
let v = [9, 8, 7, 6, 5, 0, 1, 2, 3, 4]</lang>
{{out}}
<pre>[0,1,2,3,4,5,6,7,8,9]</pre>
9,655

edits