一次过,空间复杂度为O(m+n), 下一次做的时候寻找constant space
solution。用boolean array也可以,用bit vector可能会更节省 1 import java.util.*; 2 3 public
class Solution { 4 public...
分类:
其他好文 时间:
2014-05-23 08:30:28
阅读次数:
278
1、对于string,number等基础类型,==和===是有区别的1)不同类型间比较,==之比较“转化成同一类型后的值”看“值”是否相等,===如果类型不同,其结果就是不等2)同类型比较,直接进行“值”比较,两者结果一样2、对于Array,Object等高级类型,==和===是没有区别的进行“指针...
分类:
Web程序 时间:
2014-05-22 05:12:31
阅读次数:
340
Maximum continuous sub-array.
分类:
其他好文 时间:
2014-05-22 04:36:26
阅读次数:
232
Find 2 numbers with given sum in sorted array.
分类:
其他好文 时间:
2014-05-22 01:53:17
阅读次数:
288
Find a number which appears once in an array with
all the other numbers appear twice.
分类:
其他好文 时间:
2014-05-22 01:08:40
阅读次数:
278
Reorder an array so that odd numbers come
before even numbers.
分类:
其他好文 时间:
2014-05-22 00:38:39
阅读次数:
259
一:字符替换:strtr > str_replace >
preg_replace注意:1:一般用strtr函数的这种形式:string strtr ( string $str , array
$replace_pairs )2:如果 replace_pairs 中包含一个空 字符串 (...
分类:
Web程序 时间:
2014-05-21 23:40:35
阅读次数:
357
数据类型
java数据类型基本数据类型数值型整型byte/short/int/long浮点型/double/float字符型char布尔型boolean取值true
false对象数据类型类Class接口 interface数组array[]类型 对象位数字节数最小值最大值byte Byte...
分类:
编程语言 时间:
2014-05-21 22:26:43
阅读次数:
317
题目:
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up t...
分类:
其他好文 时间:
2014-05-21 07:42:18
阅读次数:
230
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 maximu...
分类:
其他好文 时间:
2014-05-21 04:39:53
阅读次数:
332