Advertisement
snowden_web

Untitled

Jul 19th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def quick_sort(a):
  2.     if len(a) > 1:
  3.         return quick_sort(list(filter(lambda x: x < a[0], a))) + list(filter(lambda x: x == a[0], a)) + quick_sort(list(filter(lambda x: x > a[0], a)))
  4.     else:
  5.         return a
  6.  
  7. a = [7,1,2,4,8,3]
  8. print(a)
  9. print(quick_sort(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement