介绍给大家一个快速排序的方法:
void sort(int a[ ], int l, int r)
{
int i = l;
int j = r;
int mid = a[(i+j)/2];
do
{
while(a[i]
while(a[j] >mid ) j--;
if( i
{
swap( a[i], a[j] );
}...
分类:
编程语言 时间:
2014-06-20 13:15:03
阅读次数:
292
数据结构 - 简单选择排序(simple selection sort)本文地址: http://blog.csdn.net/caroline_wendy/article/details/28601965 选择排序(selection sort) : 每一趟在n-i+1个记录中选取关键字最小的记录作为有序序列中第i个记录.简单选择排序(simple selection sort) : 通过n-i次关键字之间的比较, 从n-i+1个记录中选出关键字最...
分类:
编程语言 时间:
2014-06-20 09:48:25
阅读次数:
332
脚本编程语言通常是解释型的。这类程序的执行,是由解释器读入代码,并将其转换成内部的形式,在执行。请注意,解释器本身是一般的编译型程序。
常用的脚本编程语言有 :awk,Perl,Python,Ruby,Shell。这里的Ruby是日本人研发的。
注释:
linux :
1.rm 删除指定的文件
例:rm /Users/apple/Desktop/QQDock.plist...
分类:
系统相关 时间:
2014-06-20 09:10:29
阅读次数:
371
题目链接: here。题目描述: Sort a linked list using insertion
sort. 题目要求使用插入排序的方法来实现单链表的排序。插入排序是一种简单的排序,算法描述参考维基百科,或者《算法导论》。 下面是我实现的代码: 1 /**
2 Author:...
分类:
其他好文 时间:
2014-06-12 00:39:40
阅读次数:
284
转自:http://www.linuxsa.cn/when-linux-file-name-topsy-turvy-deleted-or-renamed.htmllinux文件名乱码时删除或改名的方式当......一堆......文件出现乱码时,你想用脚本把他们改名,结果又发现字符处理工具awk等都...
分类:
系统相关 时间:
2014-06-11 12:13:39
阅读次数:
311
count(*)是否能用到索引,用索引是高效还是低效select count(*) from
aa ;首先看是否会走索引,经过试验发现,他没有走索引它的执行计划 select statement sort aggregate table access
full别说是否高效了,他连索引都没有走,索引不...
分类:
其他好文 时间:
2014-06-11 12:00:01
阅读次数:
282
Bubble sortBubble sort, sometimes incorrectly
referred to as sinking sort, is a simple sorting algorithm that works by
repeatedly stepping through the...
分类:
其他好文 时间:
2014-06-07 11:30:59
阅读次数:
390
STL实践与分析--容器特有的算法
与其它顺序容器所支持的操作相比,标准库为list容器定义了更精细的操作集合,使它不必仅仅依赖于泛型操作。当中非常大的一个原因就是list容器不是依照内存中的顺序进行布局的,不支持随即訪问,这样,在list容器上就不能使用随即訪问迭代器的算法,如sort等;还有其....
分类:
编程语言 时间:
2014-06-07 06:12:44
阅读次数:
245
Sort a linked list using insertion sort./** *
Definition for singly-linked list. * struct ListNode { * int val; * ListNode
*next; * ListNo...
分类:
其他好文 时间:
2014-06-06 10:39:38
阅读次数:
212
Given an array withnobjects colored red, white
or blue, sort them so that objects of the same color are adjacent, with the
colors in the order red, wh...
分类:
其他好文 时间:
2014-06-05 17:49:43
阅读次数:
304