Sort a linked list using insertion sort.思路:插入排序#include using namespace std;struct ListNode { int val; ListNode *next; ListNode(int x): val(x...
分类:
其他好文 时间:
2014-09-22 03:01:31
阅读次数:
159
Where is the Marble?
Where is the Marble?
Raju and Meena love to play with Marbles. They have got a lot of marbles with numbers written on them. At the beginning, Raju wou...
分类:
其他好文 时间:
2014-09-22 01:04:21
阅读次数:
477
Sedsed 是个精简的、非交互式的编辑器。他能执行和编辑vi和emacs相同的编辑任务。sed编辑器不提供交互使用方式:只能在命令行输入编辑命令、指定文件名,然后在屏幕上察看输出。sed编辑器没有破坏性。他不会修改文件,除非用shell重定向来保存输出结果。缺省情况下,所以的输出都被打印到屏幕上。...
分类:
系统相关 时间:
2014-09-22 00:39:21
阅读次数:
423
// Array对象
// 第一种构造方法
var arr = new Array();
alert(arr.length);
arr[0] = 520 ;
arr[1] = "wjp" ;
alert(arr.length);
// 第二种构造方法
// Array(4) ;
// 第三种构造方法
// Array(520, "wjp", 13...
分类:
编程语言 时间:
2014-09-21 23:42:01
阅读次数:
357
Linux sort命令用于将文本文件内容按某种方式排序,默认是ASCII码方式:
语法说明:
sort[-bcdfimMnur][-o][-t][-k][文件]
常用参数:
-b 忽略每行前面开始出的空格字符。
-c 检查文件是否已经按照顺序排序。
-d 排序时,处理英文字母、数字及空格字符外,忽略其他的字符。
-f 排序时,将小写字母视为大写字母。
-i 排序时,除了040至176之间的ASCII字符外,忽略其他的字符。
-m 将几个排序好的文件进行合并。
-M 将前...
分类:
系统相关 时间:
2014-09-21 21:56:21
阅读次数:
398
//插入排序(一维数组)//插入排序(Insertion Sort)的基本思想是:每次将一个待排序的记录,按其关键字大小插入到前面已经排好序的子文件中的适当位置,直到全部记录插入完成为止。function insert_sort($arr){ $count=count($arr); for($i=1...
分类:
其他好文 时间:
2014-09-21 21:41:31
阅读次数:
259
假设某个目录下有一堆以jpeg为后缀的文件名,我们需要在另一个目录中获得他们的文件名,并输出。可以联合使用ls,awk,sed等命令来完成。方法一:使用ls列出目录下以.jpeg为结尾的文件,然后逐个处理每一个,逐个输出。ls thepath/*.jpeg | awk -F '/' '{print $NF}' | awk -F '.' '{print $1}'方法二:最后一步不用awk,而是用se...
分类:
其他好文 时间:
2014-09-21 14:45:30
阅读次数:
200
#! /bin/sh
while true;
do
i=`df -h | egrep '/mnt/D'| awk '{print $5}' | cut -d "%" -f1 -`
if [ "$i" -ge 90 ]
then
echo "disk nearly full"
cd /mnt/D/files/
for file1day in `ls -d */ | sort -n...
分类:
系统相关 时间:
2014-09-21 00:00:59
阅读次数:
276
检查是否nfs#rpm -qa|grep nfs#rpm -qa|grep rpcbind将nfs rpcbind 设置为开机启动#chkconfig nfs on#chkconfig rpcbind on#启动 nfs rpcbinds#service rpcbind start#service....
分类:
其他好文 时间:
2014-09-20 23:48:59
阅读次数:
417
Compare methodEither you implement a compare-method for your object:- (NSComparisonResult)compare:(Person *)otherObject { return [self.birthDate co...
分类:
其他好文 时间:
2014-09-20 23:09:39
阅读次数:
263