Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def quick_sort(a):
- if len(a) > 1:
- 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)))
- else:
- return a
- a = [7,1,2,4,8,3]
- print(a)
- print(quick_sort(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement