![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
排序
星天93
很多烦恼是我们凭空虚构的,而我们却把它当做真实去承受。
展开
-
堆排序详解
堆排序详解 选择排序变形之堆排序原创 2016-12-01 12:42:53 · 537 阅读 · 0 评论 -
快速排序详解
图解过程 对于数组s = [2, 1, 3, 0, 4, 5, 8, 7, 1]进行排序 将s[0]取出作为比较值val,则s[0]位置空出 第一步,从数组右边扫描,查询第一个比val小的, 如图1查询到s[8] 将s[8]放入上一步的空格中,则s[8]空出来,如图2 第二步,从数组左边扫描,查询第一个比val大的,如图2查询到s[2] 将s[2]放入上一步的空格原创 2016-12-01 14:59:08 · 365 阅读 · 0 评论 -
计数排序
计数排序 主要是将值作为下标,然后计算有多少小于该值的数,然后再把相应的值放入到相应的位置,如果有相同的值则最先扫描到的放到可能的最后的位置。 #include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <queue> #include <algorithm> #include <map>原创 2016-12-01 17:40:09 · 449 阅读 · 0 评论 -
基数排序
#include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <queue> #include <algorithm> #include <map> #include <iomanip> #define INF 999999999 using namespace std;const int MA原创 2016-12-02 16:26:17 · 397 阅读 · 0 评论