We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e803f23 + 10b2f7a commit 81eb1d0Copy full SHA for 81eb1d0
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