Skip to content

Commit 9f10314

Browse files
authored
Add files via upload
2025/7/18
1 parent bddc45f commit 9f10314

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sorting/Quick_Sort.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ def QuickSort(arr,low,high):#遞迴排序,對基準點的左右兩邊的子數
2323
QuickSort(arr,low,pivot_index-1)
2424
QuickSort(arr,pivot_index+1,high)
2525
#直到每個子數列只剩一個元素或為空,sort完成
26+
#main function to test the quick_sort function
2627
if __name__=="__main__":
2728
new_array=[-2,10,7,5,9,13,20]
2829
print(f"Unsorted Array:{new_array}")
2930
QuickSort(new_array,0,(len(new_array))-1)
30-
print(f"Sorted Array:{new_array}")
31+
print(f"Sorted Array(quick_sort):{new_array}")

0 commit comments

Comments
 (0)