This commit is contained in:
krahets
2023-05-03 18:29:57 +08:00
parent 4eb7734fa9
commit 7645bf97df
3 changed files with 20 additions and 2 deletions
+7
View File
@@ -202,6 +202,13 @@ comments: true
=== "C"
```c title="quick_sort.c"
/* 元素交换 */
void swap(int nums[], int i, int j) {
int tmp = nums[i];
nums[i] = nums[j];
nums[j] = tmp;
}
/* 快速排序类 */
// 快速排序类-哨兵划分
int partition(int nums[], int left, int right) {