摘要: #include #include int native_string_matcher(char *str_source,char*str_pattern){int len_source = strlen(str_source);int len_pattern = strlen(str_pat... 阅读全文
posted @ 2014-07-13 17:14 dreamsyeah 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 桶排序(Bucket Sort)的原理很简单,它是将数组分到有限数量的桶子里。假设待排序的数组a中共有N个整数,并且已知数组a中数据的范围[0,MAX)。在桶排序时,创建容量为MAX的桶数组r,并将桶数组元素都初始化为0;将容量为MAX的桶数组中的每一个单元都看作一个"桶"。在排序时,逐个遍历... 阅读全文
posted @ 2014-07-13 15:07 dreamsyeah 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 希尔排序(ShellSort)是插入排序的一种,它是针对直接插入排序算法的改进。该方法又称缩小增量排序,因DL.Shell于1959年提出而得名。希尔排序实质上是一种分组插入方法。它的基本思想是:对于n个待排序的数列,取一个小于n的整数gap(gap被称为步长)将待排序元素分成若干个组子序列,... 阅读全文
posted @ 2014-07-13 12:58 dreamsyeah 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1 //////////////////////////////////////////// 2 //归并排序 // 3 //Author:Gavin Ge // 4 //Dat... 阅读全文
posted @ 2014-07-13 10:27 dreamsyeah 阅读(67) 评论(0) 推荐(0) 编辑