快速排序是不稳定的排序,但其中逻辑比较怪。 网上的教程一般只介绍第一轮排序,省略第二轮 以至于学习时把分割子序列的步骤给漏了,浪费了不少时间 这里推荐这个教程,非常详细:http://www.cnblogs.com/jingmoxukong/p/4302891.html 首先取一个关键数,并不断来回 ...
分类:
编程语言 时间:
2017-02-26 15:54:32
阅读次数:
170
https://leetcode.com/problems/search-in-rotated-sorted-array/?tab=Description 很好的很经典的题目。今天复习了一下。之前的思路虽然有了,但是对于相等的数字的处理很复杂,容易出错。今天看到了一个很好的解法。 https://d ...
分类:
编程语言 时间:
2017-02-26 13:46:01
阅读次数:
252
方法一 Array.isArray(object) 方法二 Object.prototype.toString.call(object) == [object object] 此方法可以检测所有的数据类型 ...
分类:
编程语言 时间:
2017-02-26 12:38:32
阅读次数:
178
二分查找的前提是:你得先排好序,但是排序问题不在讨论。 直接上代码: java8 出来了,有很多新的东西,optional就是其中一个,试着用一用。 ...
分类:
编程语言 时间:
2017-02-26 12:32:08
阅读次数:
180
题目: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and ...
分类:
其他好文 时间:
2017-02-26 08:19:11
阅读次数:
171
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t ...
分类:
其他好文 时间:
2017-02-26 08:18:51
阅读次数:
185
ImageTTFText 写 TTF 文字到图中。 语法: array ImageTTFText(int im, int size, int angle, int x, int y, int col, string fontfile, string text); 返回值: 数组 函数种类: 图形处理 ...
分类:
其他好文 时间:
2017-02-26 00:03:45
阅读次数:
152
code第一部分数组:第十六题 数组表示数,加一操作 Given a number represented as an array of digits, plus one to the number. ...
分类:
编程语言 时间:
2017-02-25 22:48:20
阅读次数:
195
一,数组 1,const int array[5] = {0, 1, 2, 3, 4}; 2,c99新特性,可以对指定的数组的某一个元素初始化。例如:int array[10] = {1, 3, [4] = 2, 6, 7, [1] = 32};如果多次对一个元素进行初始化,取最后一次的值。 3,c ...
分类:
编程语言 时间:
2017-02-25 22:41:12
阅读次数:
197