Compare commits
1 Commits
main
...
beppeb-pat
| Author | SHA1 | Date | |
|---|---|---|---|
| 265996e564 |
@@ -19,5 +19,5 @@ jobs:
|
||||
server: https://devstar.cn
|
||||
owner: beppeb
|
||||
repo: demo-workflow-repo
|
||||
pr_number: 8
|
||||
pr_number: 6
|
||||
|
||||
@@ -2,7 +2,7 @@ name: ai-reviews
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [created, edited]
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
review:
|
||||
|
||||
13
quicksort.py
Normal file
13
quicksort.py
Normal file
@@ -0,0 +1,13 @@
|
||||
def quick_sort(arr):
|
||||
if len(arr) <= 1:
|
||||
return arr
|
||||
pivot = arr[len(arr) // 2]
|
||||
left = [x for x in arr if x < pivot]
|
||||
middle = [x for x in arr if x == pivot]
|
||||
right = [x for x in arr if x > pivot]
|
||||
return quick_sort(left) + middle + quick_sort(right)
|
||||
|
||||
|
||||
nums = [3, 6, 8, 10, 1, 2, 1]
|
||||
print("排序前:", nums)
|
||||
print("排序后:", quick_sort(nums))
|
||||
Reference in New Issue
Block a user