Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
Line 266: | Line 266: | ||
if len(L) <= 1: return L |
if len(L) <= 1: return L |
||
pivot = random.choice(L) |
pivot = random.choice(L) |
||
return qsort([ |
return qsort([le for le in L if le <= pivot]) + [pivot] + \ |
||
qsort([ |
qsort([gt for gt in L if gt > pivot]) |
||
=={{header|Seed7}}== |
=={{header|Seed7}}== |