In article <3AE0F802.3983C9DB at 01019freenet.de>, "Oliver Korpilla" <korpo at 01019freenet.de> wrote: > Haskell Quicksort: > qsort:: Ord a=> [a] -> [a] > qsort [] = [] > qsort (x:xs) = [y | y <- xs, y <= x] ++ [x] ++ [y | y <- xs, y > x] Python Quicksort: def qsort(L): L = list(L) if L == []: return [] x, xs = L[0], L[1:] return qsort([y for y in xs if y<=x])+[x]+qsort([y for y in xs if y>x]) Though you'd be better off with a list's sort() method, of course. -- Barnabas T. Rumjuggler Thou hast been called, O Sleep! The friend of woe, But 'tis the happy who have called thee so. -- Robert Southey
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4