first_test

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-26 19:26:17 +08:00
commit b34239f5ea
29 changed files with 138300 additions and 0 deletions

7
source/quicksort.py Normal file
View File

@@ -0,0 +1,7 @@
def quicksort(arr):
if len(arr) <= 1:
return arr
pivot = arr[-1]
left = [x for x in arr[:-1] if x <= pivot]
right = [x for x in arr[:-1] if x > pivot]
return quicksort(left) + [pivot] + quicksort(right)