快速排序的中心思想
快排的边界较多,建议使用下面的模板
#include <iostream>
using namespace std;
const int N = 100010;
int n;
int q[N];
void quick_sort(int q[], int l, int r)
{
if (l >= r) return;
int i = l - 1, j = r + 1, x = q[l + r + 1 >> 1]; //快速排序的中心点是
原创
2022-01-20 15:51:11 ·
344 阅读 ·
0 评论