Compare commits
2 Commits
beppeb-pat
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 41a169f2ea | |||
| 2207c987a9 |
@@ -19,5 +19,5 @@ jobs:
|
|||||||
server: https://devstar.cn
|
server: https://devstar.cn
|
||||||
owner: beppeb
|
owner: beppeb
|
||||||
repo: demo-workflow-repo
|
repo: demo-workflow-repo
|
||||||
pr_number: 6
|
pr_number: 8
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ name: ai-reviews
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [opened, synchronize]
|
types: [created, edited]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
review:
|
review:
|
||||||
|
|||||||
13
quicksort.py
13
quicksort.py
@@ -1,13 +0,0 @@
|
|||||||
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