Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2014-10-29 19:09:20
阅读次数:
149
Part I. The CV ReviewPass the CV to THREE developersEach dev should mark YES/NO on the CVReject any CVs with TWO No'sPart II. The Phone Interview1. Wh...
分类:
其他好文 时间:
2014-10-29 19:09:12
阅读次数:
222
D - Two paths
只想到了一个o(n^2)的解法。
首先枚举删除一条边,必然得到两棵独立的树。计算两棵树的直径。保留最大乘积。
首先两条路不相交,则必然可以分到两棵子树中,因为要乘积最大,所以两条路必为两棵子树的直径。
#include
#include
#include
#include
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2014-10-29 17:12:24
阅读次数:
225
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-10-29 16:22:58
阅读次数:
209
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...
分类:
其他好文 时间:
2014-10-29 14:59:27
阅读次数:
180
In a word, 简单的说:这两个术语一个用在函数定义时,一个用在函数调用时~These two terms are sometimes loosely used interchangeably; in particular, "argument" is sometimes used in pl...
分类:
其他好文 时间:
2014-10-29 12:13:50
阅读次数:
134
Delphi 正则表达式语法(8): 引用子表达式 - 也叫反向引用//准备: 我们先写一个搜索所有英文单词的表达式var reg: TPerlRegEx;begin reg := TPerlRegEx.Create(nil); reg.Subject := 'one two three four ...
此题要求用归并排序排两个链表,基本思想还是分为分割和合并
合并的代码在Merge Two Sorted List里已经讲得很清楚了。所以这里直接给出代码。...
分类:
其他好文 时间:
2014-10-29 09:15:29
阅读次数:
181
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
public class Solution {
//模拟手算乘法
...
分类:
编程语言 时间:
2014-10-29 09:14:28
阅读次数:
168
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100". 1 public class Solution { 2 public String ...
分类:
其他好文 时间:
2014-10-29 00:11:02
阅读次数:
245