You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Quicksort.md
+9-7
Original file line number
Diff line number
Diff line change
@@ -64,32 +64,33 @@ $$
64
64
### 一行实现
65
65
66
66
```python
67
-
quick_sort =lambdaarray: array iflen(array) <=1else quick_sort([item for item in array[1:] if item <= array[0]]) + [array[0]] + quick_sort([item for item in array[1:] if item > array[0]])
67
+
quick_sort =lambdaarray: array iflen(array) <=1else quick_sort([item for item in array[1:] if(item > array[0] if reverse else item <= array[0])]) + [array[0]] + quick_sort([item for item in array[1:] if(item <= array[0] if reverse else item > array[0])])
0 commit comments