随笔分类 -  0x05 排序

1.离散化 2.中位数(货仓选址) 3.第k大数(快速排序O(n)) 4.逆序对(归并)
归并排序、逆序对
摘要:归并排序O(nlong) 1 #include<bits/stdc++.h> 2 #define N 100010 3 using namespace std; 4 5 int n; 6 int a[N],tmp[N]; 7 void merge_sort(int l,int r) { 8 if(l 阅读全文
posted @ 2022-04-22 19:12 我疯故我在 阅读(6) 评论(0) 推荐(0) 编辑
快速排序,第k小数
摘要:快速排序O(nlong) 1 #include<bits/stdc++.h> 2 #define N 100010 3 using namespace std; 4 5 int n; 6 int a[N]; 7 void qsort(int l,int r) { 8 if(l>=r) return; 阅读全文
posted @ 2022-04-22 19:06 我疯故我在 阅读(33) 评论(0) 推荐(0) 编辑




点击右上角即可分享
微信分享提示