Skip to content

Instantly share code, notes, and snippets.

@ranisalt
Created November 3, 2014 17:03
Show Gist options
  • Save ranisalt/958d25f12d5de341f5b4 to your computer and use it in GitHub Desktop.
Save ranisalt/958d25f12d5de341f5b4 to your computer and use it in GitHub Desktop.
Quicksort funcional
def quicksort(l):
if len(l) == 0:
return l
pivot = l.pop()
return quicksort([x for x in l if x < pivot]) + [pivot] + quicksort([x for x in l if x >= pivot])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment