Sorting algorithms/Quicksort: Difference between revisions

Content added Content deleted
Line 262:
a = quickSort(a)
In a Haskell fashion:
import random
def qsort(L):
if len(L) <= 1: return L
pivot, L = random.choice(L)[0], L[1:]
return qsort([lty for lty in L if lty <= pivot]) + [pivot]*L.count(pivot) + \
qsort([gty for gty in L if gty > pivot])
 
=={{header|Seed7}}==