![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序算法
SinclairWang
A very self-motivated person, a very modest man,and also a man does not fear endures hardship.
展开
-
HDU1425 Sort【排序/哈希】
HDU1425 Sort 使用scanf/printf进行输入输出,不然会TLE Sort解法 #include<iostream> #include<algorithm> #include<functional> using namespace std; const int maxn = 1e6+9; int a[maxn]; int main(){ int...原创 2020-04-14 21:57:30 · 210 阅读 · 0 评论 -
TOP-K问题
常见的Top k问题,下面以多种解法来解决这个问题 下面拿一道Leetcode上的题目来练练手。 面试题40. 最小的k个数 题意:返回最小的k个数 文章目录快速排序大根堆nth_elementpartitionBFPRT 快速排序 其实最简单的思路是排一下序,然后把前k个返回 class Solution { public: vector<int> getLeastNumbe...原创 2020-03-23 16:02:19 · 216 阅读 · 0 评论