/** * nums的所有元素,假设最大能连续形成[1,sum] 当增加一个element的时候 * 会变成 [1,sum] [element+1,sum+element]两个区间,这两个区间有以下可能性: * 1 相交: element < sum * 2 连续: element = sum 是保
分类:
其他好文 时间:
2016-03-10 12:42:12
阅读次数:
116
package org.hanqi.array; import java.util.*; public class Text1 { public static void main(String[] args) { // 创建List:指明数据类型,不需要指定大小 // <>表示泛型 List<Str
分类:
其他好文 时间:
2016-03-10 12:31:39
阅读次数:
120
//方法一 var arr = [1,2,3]; var obj = {'name': 'xiaoming','age': 19}; if(arr.constructor == Array){ alert(1); } //方法二 if(Array.isArray(arr)){ alert(1); }
分类:
编程语言 时间:
2016-03-10 10:52:51
阅读次数:
214
动态规划求最大连续子序列: 思想: 1、如果在array[1,N]中存在最大连续子序列array[i,j],那么对于任何的k(i<=k<=j)均有array[i,k]大于0。假设array[i,k]小于0,由条件知array[i,j]为最大连续子序列,且由等式array[i,k](小于0)+arra
分类:
其他好文 时间:
2016-03-10 09:23:07
阅读次数:
189
Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the l
分类:
其他好文 时间:
2016-03-10 09:16:57
阅读次数:
168
1. Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your ma
分类:
其他好文 时间:
2016-03-09 23:44:44
阅读次数:
198
将1~100之间的所有正整数存放在一个List集合里,并将集合中索引位置是10的对象从集合中移除 package org.hanqi.array; import java.util.*; public class Test { public static void main(String[] arg
分类:
其他好文 时间:
2016-03-09 20:54:55
阅读次数:
189
一. 获取Url中searchParams getQueryParamsMap: function(searchUrlWithoutQuestionMark) { var result = {}; var array = searchUrlWithoutQuestionMark.split('&')
分类:
移动开发 时间:
2016-03-09 17:26:47
阅读次数:
148
题目来源: https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ 题意分析: 给出一个排好序的数组,根据这个数据形成一个高度平衡的搜索二叉树。 题目思路: 将中位数为根节点,中位数左边为左子树,右边为右子树
分类:
编程语言 时间:
2016-03-09 16:02:05
阅读次数:
200
c/c++中const详解 来自http://blog.csdn.net/lwbeyond/article/details/6187501 一. cons 的作用 (1) 可以定义 const 常量 const int Max=100; int Array[Max]; (2) 可以保护被修饰的东西,
分类:
编程语言 时间:
2016-03-09 16:01:37
阅读次数:
179