摘要: 其中冒泡排序加个标志,所以最好情况下是o(n) 直接选择排序: 排序过程: 1 、首先在所有数据中经过 n-1次比较选出最小的数,把它与第 1个数据交换, 2、然后在其余的数据内选出排序码最小的数,与第 2个数据交换...... 依次类推,直到所有数据排完为止。 在第i 趟排序中选出最小关键字的数据 阅读全文
posted @ 2017-02-14 21:14 simple_wxl 阅读(128731) 评论(1) 推荐(6) 编辑
摘要: struct node{ int id; int cnt; node(int _id,int _cnt):id(_id),cnt(_cnt){} bool operator<(node a) const{return cnt<a.cnt;} bool operator>(node a) const{ 阅读全文
posted @ 2017-02-14 13:42 simple_wxl 阅读(933) 评论(0) 推荐(0) 编辑