Given a singly linked list
L: L0→L1→…→Ln-1→Ln,
reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…
You must do this in-place without altering the nodes' values.
For example,
Given {1,2,3,4}, r...
分类:
其他好文 时间:
2014-06-03 03:12:46
阅读次数:
222
当一个组件tree在一个postbacks请求中被恢复之后其中每个组件从request的参数中取得各自的值,这里使用的是processDecodes方法。这个值会保存在本地的每个组件中,在源码中此过程的代码较为简单,因为实现者将取值这个操作全部封装在processDecodes方法中。不过说实话JSF的这部分的实现非常失败,因为在UIViewRoot中有将近两千行代码,这,这,这……...
分类:
移动开发 时间:
2014-06-02 23:05:34
阅读次数:
363
http://poj.org/problem?id=3101这道题就是求所有分子的最小共倍数和分母的最大公约数。 1 import
java.math.BigInteger; 2 import java.util.*; 3 import java.util.Arrays; 4 public
clas...
分类:
其他好文 时间:
2014-06-02 16:48:42
阅读次数:
255
【题目】
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 1
\ / / / \ 3 2 1 ...
分类:
其他好文 时间:
2014-06-01 15:34:24
阅读次数:
231
【题目】
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
1 3 3 2 1
\ / / / \ ...
分类:
其他好文 时间:
2014-06-01 15:33:45
阅读次数:
297
【题目】
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solution is trivial, could you do it iteratively?
confused what "{1,#,2...
分类:
其他好文 时间:
2014-06-01 13:01:23
阅读次数:
279
Merge Sorted ArrayGiven 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 ...
分类:
其他好文 时间:
2014-06-01 12:04:32
阅读次数:
175
在整个JSF生命周期中经历了取值、验证的阶段最终从request中拿到合理的值,下面就是在本阶段给相应的服务端对象(ManageBean)赋值了。JSF实现只是去更新和input组件中value属性对应的bean的属性的值,也就是说如果在界面上没有讲ManageBean的属性“绑定”到Input类的组件中那么这个Bean的属性是不会更新的。这里需要留意的是如果本地的数据不能转化为对应Bean的属性...
分类:
Web程序 时间:
2014-06-01 09:48:58
阅读次数:
300
【题目】
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 to m + n) to hold additional elements from B. The number of elements initialized in A and B are...
分类:
其他好文 时间:
2014-06-01 09:21:16
阅读次数:
292
【题目】
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gray code. A gray code sequence must begin with 0.
...
分类:
其他好文 时间:
2014-06-01 09:16:29
阅读次数:
242