Message Board


Message Board > Others > Amazing

June 28, 2007, 12:15
Gobliz
一年
75 posts

Code:
qsort [ ]    = [ ]
qsort (x:xs) = qsort us ++ [x] ++ qsort vs 
               where
                 us = [ u | u <- xs, u < x ]
                 vs = [ u | u <- xs, u >= x]


Quicksort in only 5 lines. I love the functional programming :praise:
____________
Cap'n Jimbo Catfish worklog
#

Message Board > Others > Amazing

Quick reply


You must log in or register to post.
Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!