Skip to content

Instantly share code, notes, and snippets.

@wanysteus
Last active October 26, 2024 09:03
Show Gist options
  • Select an option

  • Save wanysteus/52f2096461ea7cbbd7c006e4df15c4ef to your computer and use it in GitHub Desktop.

Select an option

Save wanysteus/52f2096461ea7cbbd7c006e4df15c4ef to your computer and use it in GitHub Desktop.
QuickSort, condensed version
def quicksort(L):
return L if len(L) <= 1 else quicksort([e for e in L[1:] if e <= L[0]]) + [L[0]] + quicksort([e for e in L[1:] if e > L[0]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment