Skip to content

Instantly share code, notes, and snippets.

@bernEsp
Created September 7, 2017 21:23
Show Gist options
  • Save bernEsp/7665136f70e0163819934627dfa2ee31 to your computer and use it in GitHub Desktop.
Save bernEsp/7665136f70e0163819934627dfa2ee31 to your computer and use it in GitHub Desktop.
python quick_sort
def quick_sort(array):
value = random.choice(array)
l = []
r = []
c = []
for i in array:
if i < value:
l.append(i)
elif i > value:
r.append(i)
else:
c.append(i)
if len(l) > 1:
l = mistery(l)
if len(r) > 1:
r = mistery(r)
return l + c + r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment