ByteBuffer position limit flip...
分类:
其他好文 时间:
2014-06-05 10:23:51
阅读次数:
185
【题目】
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
【题意】
给定一个mXn的矩阵,如果其中的元素为0,则对应的行和列都用0填充。
不能申请额外的空间。
【思路】
第一行和第一列空出来标记需要置0的列和行
第一遍扫描:
扫描第一行,判断第一行是否需要清零
...
分类:
其他好文 时间:
2014-06-05 08:07:11
阅读次数:
229
【题目】
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
【题意】
有个梯子有n阶,每次只能爬1阶或者2阶,为爬到梯子顶共有多少种爬法
【思路】
依次确定跳到每一阶上的爬法数目
这其实是一...
分类:
其他好文 时间:
2014-06-05 07:16:08
阅读次数:
203
1.Collection
和 Collections
的区别。
Collection
是集合类的上级接口,继承于他的接口主要有
Set 和
List.
Collections 是针对集合类的一个帮助类,他提供一系列静态方法实现对各种集合的搜索、排序、线程安全化等操作。
2.HashMap
和 Hashtable
的区别。
HashMap 是...
分类:
编程语言 时间:
2014-06-05 01:25:20
阅读次数:
296
【题目】
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the problem statement to be ambiguous. You should gather all requirements up front before imple...
分类:
其他好文 时间:
2014-06-04 23:45:09
阅读次数:
388
【题目】
Implement int sqrt(int x).
Compute and return the square root of x.
【题意】
实现 int sqrt(int x),计算并返回平方根。
【思路】
用牛队迭代法求解,本题可以转化为求 f(n)=n^2-x=0的解
用牛顿迭代法不断逼近真实解,假设曲线上有点(n[i],f(n[i]))
则这点出的斜率为2ni, 通过该点的直线方程为 y=2n[i](...
分类:
其他好文 时间:
2014-06-04 23:38:20
阅读次数:
325
【题目】
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.
You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad ...
分类:
其他好文 时间:
2014-06-04 22:37:46
阅读次数:
389
产品简介
E-SoonLink将集中管理与远程接入完美地结合起来,使用金万维异速 联可以方便、安全及时地接入到公司内部应用信息系统。应用程序能集中 发布,避免在每台电脑重复安装、调试、更新应用软件,从而降低大量成 本,提升工作效率,大大简化部署与管理复杂的计算环境。 ? 它是一种在服务器上100%地安装、管理、支持和执行应用程序的计算模 式,所有计算均在服务器上执行,而只有键盘信息、鼠标点击和屏...
分类:
其他好文 时间:
2014-05-31 21:54:24
阅读次数:
255
【题目】
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1->1->2->3, return 2->3.
【题意】
给定一个有序链表,删出其中重复出现的值...
分类:
其他好文 时间:
2014-05-31 21:14:11
阅读次数:
333