选择排序的基本思想:每次选择未排序元素中的最小(非增序列)或者最大(非减序列)的一个一次加入到已排序序列后面,直到所有元素都排序完#include void selection_sort(int arr[],int length){ int i,j; for (i = 0; i < le...
分类:
编程语言 时间:
2014-10-12 12:23:07
阅读次数:
173
#encoding=utf-8__author__ = 'kevinlu1010@qq.com'################# python自带的排序接口 ###################### python内带非常强大的排序函数,sorted,或sort# sorted是内建函数,sor...
分类:
编程语言 时间:
2014-10-12 11:54:27
阅读次数:
242
#!/bin/sh
# Find ip
IP=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{ print substr($2, index($2, ":")+1)}'`
#monitor procname scriptname
monitor()
{
procname=$1
scriptname=$2
# Find proc by p...
分类:
Web程序 时间:
2014-10-12 10:46:07
阅读次数:
267
It is quite a basic problem. However I spent half an hour solving it and made two mistakes. Guess it's because I haven't written some fundamental data structures like linked list for a while and kind...
分类:
其他好文 时间:
2014-10-12 09:08:27
阅读次数:
176
1 #include ; 2 3 using namespace std; 4 void insertion_sort(int * arr, int length); 5 6 int main() 7 { 8 int arr[] = {2,45,5,8,10,4,9,45,8,36,1...
分类:
编程语言 时间:
2014-10-12 04:03:17
阅读次数:
178
归并排序(Merge sort)是创建在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。一个归并排序的例子:对一个随机点的链表进行排序本文地址:http://www.cnblogs.com/archimedes/p/merge-sort...
分类:
编程语言 时间:
2014-10-12 02:25:07
阅读次数:
255
#!/bin/sh
my_ip=`/sbin/ifconfig eth1 | grep 'inet addr' | awk '{print substr($2, index($2, ":")+1)}'`
recv=""
msg="not_existing, restart ..."
MONITOR_LOG="monitor.log"
#monitor procname scriptname...
分类:
系统相关 时间:
2014-10-11 23:25:07
阅读次数:
329
内容提要1. 第一难度, 重要 梯队 (grep, awk, sed, find, )2. 第二常用, 重要 梯队 (ps, ls, date, fuser, netstat, kill)3. 第三 特殊用途 梯队 (压缩打包, 背景运行, 工作例程, 性能监控, 安装包)4. 正则表达式一. 难度...
分类:
系统相关 时间:
2014-10-11 17:22:45
阅读次数:
226
ROOT = $(shell pwd) 获得Makefile的当前路径$(shell find $(SRC_DIR) -name '*.h') #寻找SRC_DIR所代表目录下的所有名字后缀为.h的头文件 $(sort $(foreach i, $(INC_DIR), -I$(i))) #对INC....
分类:
其他好文 时间:
2014-10-11 16:32:45
阅读次数:
190
https://oj.leetcode.com/problems/insertion-sort-list/插入排序为假设[0,i)已经为有序数组,下一步从[i,n)找最小的元素交换到i处。用指针模拟这个过程即可。就是操作有些麻烦。每次[head,p)为已经有序的数组,下次从[p,tail]找出最小的...
分类:
编程语言 时间:
2014-10-11 01:46:54
阅读次数:
327