ln -s /etc /etc/rc.dln -s /usr/bin/awk /bin/awkln -s /usr/bin/basename /bin/basenameln -s /usr/bin/rpm /bin/rpmln -s /lib/i386-linux-gnu/libgcc_s.so.1...
分类:
数据库 时间:
2014-06-28 23:38:22
阅读次数:
467
在STL中,排序是个很重要的话题。1.algorithm 里的sort()只接收RandomAccessIterator用于像vector,dequeue的排序2.像set,map,这种关联式容器,本身就由RBTree维护了有序,只要遍历一遍就行了。3.而list比较特殊一点,由于只有Bidirec...
分类:
其他好文 时间:
2014-06-28 22:09:39
阅读次数:
209
1- "原地"排序-转换后替换>>> list = [2,1,3]>>> list.sort()>>> list[1, 2, 3]降序 reverse = True>>> list.sort(reverse = True)>>> list[3, 2, 1, 1]2- "复制"排序-转换然后返回>>>...
分类:
编程语言 时间:
2014-06-28 20:04:47
阅读次数:
299
Sort a linked list using insertion sort.单链表的插入排序, 考查的时单链表指针的断开和插入操作#include #include #include using namespace std;struct ListNode{ int val; List...
分类:
其他好文 时间:
2014-06-21 12:26:49
阅读次数:
206
分治法的典例
当练手了
神奇的是,使用inplace_merge按说应该是O(n)的算法,但是用sort nlogn的算法反而更快
先上快排版
#include
#include
#include
#include
#include
using namespace std;
const int SIZE = 10000+10;
const double INF = 1...
分类:
其他好文 时间:
2014-06-18 07:17:22
阅读次数:
170
awk文本高级编辑,linux shell文本处理...
分类:
其他好文 时间:
2014-06-18 07:16:01
阅读次数:
415
原题如下,意思就是说无序数组(由0,1,2组成),一遍扫描,把数组整理成0,1,2这样的序列。
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,...
分类:
其他好文 时间:
2014-06-18 07:12:43
阅读次数:
174
[1.1]使用库语言排序算法本文地址: http://blog.csdn.net/caroline_wendy如果不缺少内存, 可以直接使用库的排序算法.使用库语言的排序程序:C语言性能最好的算法是快速排序(quick sort).C++性能最好的是集合(set)的排序算法.C语言代码:/*
* main.cpp
*
* Created on: 2014.6.12
* Auth...
分类:
其他好文 时间:
2014-06-18 00:40:02
阅读次数:
269
归并排序(merging sort): 包含2-路归并排序, 把数组拆分成两段, 使用递归, 将两个有序表合成一个新的有序表.归并排序(merge sort)的时间复杂度是O(nlogn), 实际效果不如快速排序(quick sort)和堆排序(heap sort),但是归并排序是稳定排序, 而.....
分类:
其他好文 时间:
2014-06-17 23:47:38
阅读次数:
299
awk实用功能:(来自网友StephenLiu)和sed一样,awk也是逐行扫描文件的,从第一行到最后一行,寻找匹配特定模板的行,并在这些行上运行“选择”动作。如果一个模板没有指定动作,这些匹配的行就被显示在屏幕上。如果一个动作没有模板,所有被动作指定的行都被处理。awk的基本格..
分类:
其他好文 时间:
2014-06-17 18:35:01
阅读次数:
270