Skip to content

Instantly share code, notes, and snippets.

@tuvo1106
Last active July 4, 2019 16:57
Show Gist options
  • Save tuvo1106/deed0c4dcac25c72e630bdef6908a6c6 to your computer and use it in GitHub Desktop.
Save tuvo1106/deed0c4dcac25c72e630bdef6908a6c6 to your computer and use it in GitHub Desktop.
def quicksort(l:list):
arr = l[::]
if len(arr) <= 1:
return arr
l = [x for x in arr[1:] if x <= arr[0]]
r = [x for x in arr[1:] if x > arr[0]]
return quicksort(l) + arr[0:1] + quicksort(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment