原题地址:http://oj.leetcode.com/problems/two-sum/题意:找出数组numbers中的两个数,它们的和为给定的一个数target,并返回这两个数的索引,注意这里的索引不是数组下标,而是数组下标加1。比如numbers={2,7,11,17};
target=9。那...
分类:
编程语言 时间:
2014-04-30 21:45:43
阅读次数:
528
原题地址:http://oj.leetcode.com/problems/3sum/题意:从一个数组中找到三个数,使这三个数的和为0。有可能存在多组解,也有可能存在重复的解,所以需要去重。比如:num=[-1,0,1,2,-1,-4];那么存在两组解:[[-1,0,1],[-1,-1,2]],解中的...
分类:
编程语言 时间:
2014-04-30 19:15:53
阅读次数:
566
Given an arraySofnintegers, are there
elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in
the array which gives the sum of ...
分类:
其他好文 时间:
2014-04-29 22:40:00
阅读次数:
438
[leetcode]Word Ladder II @
Python原题地址:http://oj.leetcode.com/problems/word-ladder-ii/参考文献:http://blog.csdn.net/doc_sgl/article/details/13341405
ht...
分类:
编程语言 时间:
2014-04-29 21:42:30
阅读次数:
590
public abstract
classAsyncTaskextendsObjectjava.lang.Object?android.os.AsyncTaskClass
OverviewAsyncTask enables proper and easy use of the UI thread. ...
分类:
移动开发 时间:
2014-04-29 21:05:32
阅读次数:
748
2014-04-29
00:15题目:将二叉搜索树展开成一个双向链表,要求这个链表仍是有序的,而且不能另外分配对象,就地完成。解法:Leetcode上也有,递归解法。代码: 1 //
17.13 Flatten a binary search tree into a doubly linked li...
分类:
其他好文 时间:
2014-04-29 14:51:49
阅读次数:
460
2014-04-29
03:05题目:给定一个词典,其中某些词可能能够通过词典里其他的词拼接而成。找出这样的组合词里最长的一个。解法:Leetcode上有Word
Break这道题,和这题基本思路一致。代码: 1 // 18.7 Given a list of words, find out the...
分类:
其他好文 时间:
2014-04-29 14:30:17
阅读次数:
493
2014-04-29
04:22题目:给定一堆长度都相等的单词,和起点、终点两个单词,请从这堆单词中寻找一条变换路径,把起点词变成终点词,要求每次变换只能改一个字母。解法:Leetcode中有Word
Ladder,这题基本思路一致。代码: 1 // 18.10 Given a list of wo...
分类:
其他好文 时间:
2014-04-29 14:15:57
阅读次数:
507
Given a matrix ofmxnelements (mrows,ncolumns),
return all elements of the matrix in spiral order.For example,Given the
following matrix:[ [ 1, 2, 3 ],...
分类:
其他好文 时间:
2014-04-29 10:37:46
阅读次数:
434
You are given two linked lists representing two
non-negative numbers. The digits are stored in reverse order and each of their
nodes contain a single ...
分类:
其他好文 时间:
2014-04-29 10:17:46
阅读次数:
406