继上一篇堆排序之后,用相同的数据结构写了个快速排序和插入排序,当数组的长度较小的时候,可使用插入排序,实现如下:QuickSort.h 1 #ifndef
__QUICKSORT 2 #define __QUICKSORT 3 #include "MySqList.h" 4 #include "In...
分类:
其他好文 时间:
2014-06-06 10:50:30
阅读次数:
282
原题地址:https://oj.leetcode.com/problems/distinct-subsequences/题意:Given
a stringSand a stringT, count the number of distinct subsequences ofTinS.A
subseq...
分类:
编程语言 时间:
2014-06-06 09:59:43
阅读次数:
330
python中import一个模块时python解释器的搜索目录顺序:参考python帮助文档The
Module Search PathWhen a module namedspamis imported, the interpreter first
searches for a built-in...
分类:
其他好文 时间:
2014-06-06 09:45:30
阅读次数:
250
二分法插入排序算法思想简单描写叙述:在插入第i个元素时,对前面的0~i-1元素进行折半,先跟他们中间的那个元素比,假设小,则对前半再进行折半,否则对后半进行折半,直到left>right,然后再把第i个元素前1位与目标位置之间的全部元素后移,再把第i个元素放在目标位置上。二分法没有排序,仅仅有查找。...
分类:
其他好文 时间:
2014-06-06 09:20:35
阅读次数:
224
在使用mysql排序的时候会想到按照降序分组来获得一组数据,而使用order
by往往得到的不是理想中的结果,那么怎么才能使用group by 和order by得到理想中的数据结果呢?例如有一个 帖子的回复表,posts( id ,
tid , subject , message , dateli...
分类:
数据库 时间:
2014-06-06 08:17:08
阅读次数:
311
import static org.junit.Assert.*;import
java.util.Arrays;import org.junit.Test;public class SortAlgorithms { /** *
归并排序算法 * * @param a * @return */ st...
分类:
其他好文 时间:
2014-06-06 07:26:53
阅读次数:
273
原题地址:https://oj.leetcode.com/problems/interleaving-string/题意:Givens1,s2,s3,
find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1...
分类:
编程语言 时间:
2014-06-06 07:26:08
阅读次数:
351
import static org.junit.Assert.*;import
java.util.Arrays;import org.junit.Test;public class SortAlgorithms { /** *
插入排序算法 * * @param n...
分类:
其他好文 时间:
2014-06-06 07:07:40
阅读次数:
205
Windows下的Apache+Mysql+Perl/PHP/Python,一组常用来搭建动态网站或者服务器的开源软件,本身都是各自独立的程序,但是因为常被放在一起使用,拥有了越来越高的兼容度,共同组成了一个强大的Web应用程序平台。随着开源潮流的蓬勃发展,开放源代码的LAMP已经与J2EE和.Ne...
分类:
其他好文 时间:
2014-06-06 06:42:57
阅读次数:
525