1.Problem DescriptionGiven a sequence
a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a
sub-sequence. For example, given (6,-1,5,4,-...
分类:
其他好文 时间:
2014-06-02 17:36:53
阅读次数:
234
1、编写native方法(java2c)和非native方法(c2java):package
com.example.provider;public class CallbackJava { // C调用java空方法 public void
helloFromJava() { ...
分类:
移动开发 时间:
2014-06-02 16:42:34
阅读次数:
413
问题:
给定一个字符串数组words,一个整数L,将words中的字符串按行编辑,L表示每行的长度。
要求:
1)每个单词之间至少是有一个空格隔开的。
2)最后一行每个单词间只间隔一个空格, 最后一个单词后不足L长度的用空格填充。
3)除最后一行外,其他行进行填充长度的空格要均分,不能均分的,将余数代表的空格数依次填充在行左。
For example,
words: ["Th...
分类:
其他好文 时间:
2014-06-01 15:43:03
阅读次数:
297
【题目】
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
【题目】
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the following condition:
1 ≤ m ≤ n ≤ length of list.
【题意】
...
分类:
其他好文 时间:
2014-06-01 15:08:34
阅读次数:
237
问题:
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
分析:
...
分类:
其他好文 时间:
2014-06-01 15:04:42
阅读次数:
259
问题:
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
and...
分类:
其他好文 时间:
2014-06-01 13:03:12
阅读次数:
324
【题目】
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.35"]. (Order does not matter)
【题意】
给定一个字符串,恢复并返回所有符合条件的IP串
【思路】...
分类:
其他好文 时间:
2014-06-01 13:01:56
阅读次数:
295
【题目】
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