2 parents e803f23 + 10b2f7a commit 81eb1d0Copy full SHA for 81eb1d0
1 file changed
quick_sort.py
@@ -74,7 +74,7 @@ def qsort(list):
74
return []
75
else:
76
pivot = list[0]
77
- less = [x for x in list if x < pivot]
+ less = [x for x in list[1:] if x < pivot]
78
more = [x for x in list[1:] if x >= pivot]
79
return qsort(less) + [pivot] + qsort(more)
80
"""
0 commit comments