Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-12-22 19:18:27
阅读次数:
180
下面我们来看一看策略模式的UNL类图 下图是一个典型的折扣系统 运用到了策略模式UML类图 ![在此输入图片描述][1] [1]: http://static.oschina.net/uploads/space/2014/1222/141340_ZT9s_876290.jpg 关键代码 Serv...
分类:
其他好文 时间:
2014-12-22 16:25:56
阅读次数:
233
leetcode新題,Majority Element ,难度easy。题意:给定一个长度为n的数组,找出majority element,所谓majority element就是出现次数大于n/2的那个数。
很简单的题目,解法很多:
Runtime: O(n2) — Brute force solution: Check each element if it is the majority element.
Runtime: O(n), Space: O(n) — Hash table: Maintain...
分类:
其他好文 时间:
2014-12-22 16:15:26
阅读次数:
141
Often time, Tomcat may hits the following java.lang.OutOfMemoryError: PermGen space error.java.lang.OutOfMemoryError: PermGen space at java.lan...
分类:
编程语言 时间:
2014-12-22 16:08:18
阅读次数:
169
![在此输入图片描述][1] [1]: http://static.oschina.net/uploads/space/2014/1222/113345_7JON_876290.jpg 1:虚线箭头表示依赖关系 2:空心的三角形+实线表示继承关系 3:实心的菱形+实线箭头表示组合关系:强的拥...
分类:
其他好文 时间:
2014-12-22 13:05:04
阅读次数:
257
PermGen space的全称是Permanent Generation space,是指内存的永久保存区域OutOfMemoryError: PermGen space从表面上看就是内存益出,解决方法也一定是加大内存。说说为什么会内存益出:这一部分用于存放Class和Meta的信息,Class在...
分类:
编程语言 时间:
2014-12-22 12:32:35
阅读次数:
146
css隐藏多余文字并用...表示未完的内容使用到的css属性width:***, overflow:hidden, text-overflow:ellipsis多余的文字用...显示。, white-space:nowrap保持文字在一行显示不折行text-overflow:clip | ellip...
分类:
Web程序 时间:
2014-12-22 00:47:20
阅读次数:
272
1.你定死表格的宽度,即给表格一个宽度值(是数值,不是百分比)2.强制不换行div{//white-space:不换行;normal 默认;nowrap强制在同一行内显示所有文本,直到文本结束或者遭遇 br 对象white-space:nowrap; }自动换行div{word-wrap: brea...
分类:
Web程序 时间:
2014-12-21 23:32:08
阅读次数:
258
题目:
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in place w...
分类:
其他好文 时间:
2014-12-21 22:08:30
阅读次数:
178