Skip to content

Commit

Permalink
add recursive quick sort
Browse files Browse the repository at this point in the history
  • Loading branch information
metehaansever committed Oct 31, 2019
1 parent e48d6c0 commit 0982255
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recursive-quick-sort.py
@@ -0,0 +1,6 @@
def quick_sort(l):
if len(l) <= 1:
return l
else:
return quick_sort([e for e in l[1:] if e <= l[0]]) + [l[0]] +\
quick_sort([e for e in l[1:] if e > l[0]])

0 comments on commit 0982255

Please sign in to comment.