A. LCISTime Limit:2000msCase Time Limit:2000msMemory Limit:32768KB64-bit integer IO format:%I64d Java class name:MainGiven n integers.You have two ope...
分类:
其他好文 时间:
2014-07-13 23:34:39
阅读次数:
272
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 ...
分类:
其他好文 时间:
2014-07-13 17:21:40
阅读次数:
208
Design an algorithm and write code to find the first common ancestory of two nodes in a binary tree. Avoid storing additional nodes in data structure....
分类:
其他好文 时间:
2014-07-13 13:24:21
阅读次数:
279
You have two very large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of ...
分类:
其他好文 时间:
2014-07-13 13:04:00
阅读次数:
186
Just like normal variables, pointers can be declared constant. There are two different ways that pointers and const can be intermixed, and they are very easy to mix up.
To declare a const pointer, ...
分类:
其他好文 时间:
2014-07-12 21:20:23
阅读次数:
165
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. Y...
分类:
其他好文 时间:
2014-07-12 20:39:17
阅读次数:
225
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
public class Solution {
public String addBinary(String a, String b) {
...
分类:
其他好文 时间:
2014-07-12 19:42:26
阅读次数:
168
问题:
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:
Only one letter can be changed at a time
Each intermediate wo...
分类:
编程语言 时间:
2014-07-12 19:21:38
阅读次数:
290
Flip Game
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 29865
Accepted: 12943
Description
Flip game is played on a rectangular 4x4 field with two-sided p...
分类:
其他好文 时间:
2014-07-12 19:15:30
阅读次数:
136
Problem Description
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime...
分类:
其他好文 时间:
2014-07-12 16:42:15
阅读次数:
271