Sorting algorithms/Quicksort: Difference between revisions
Content deleted Content added
→{{header|C}}: Added C++ |
→{{header|Python}}: fix a bug |
||
Line 559: | Line 559: | ||
In a Haskell fashion: |
In a Haskell fashion: |
||
def qsort(L): |
def qsort(L): |
||
return (qsort([y for y in L[1:] if y <= L[0]]) + |
|||
L[:1] + |
|||
qsort([y for y in L[1:] if y > L[0]])) if len(L) > 1 else L |
|||
qsort([y for y in L if y > pivot]) |
|||
=={{header|Scheme}}== |
=={{header|Scheme}}== |