一次过,空间复杂度为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
Binary search tree to sorted double linked list.
分类:
其他好文 时间:
2014-05-22 05:30:47
阅读次数:
207
with语句,函数,列表推导,集合,排序,字符分割的应用,set(),sorted(),split()
分类:
编程语言 时间:
2014-05-22 05:15:55
阅读次数:
264
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
ThinkPHP的配置非常灵活,可自定义加载.大概看了一下,一共有这几个地方会加载配置文件,方便以后的读取/**
*获取和设置配置参数支持批量定义
*
*@paramstring|array$name
*配置变量
*@parammixed$value
*配置值
*@returnmixed
*/
functionC($name=null,$value=null){
static$_con..
分类:
Web程序 时间:
2014-05-20 20:13:46
阅读次数:
347