Last active
July 4, 2019 16:57
-
-
Save tuvo1106/deed0c4dcac25c72e630bdef6908a6c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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