码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
LeetCode:Reverse Words in a String
Reverse Words in a String题目链接:http://oj.leetcode.com/problems/reverse-words-in-a-string/ Given an input string, reverse the string word by word. F...
分类:其他好文   时间:2014-07-22 23:13:32    阅读次数:309
[leetcode]Insertion Sort List @ Python
原题地址:http://oj.leetcode.com/problems/insertion-sort-list/题意:对链表进行插入排序。解题思路:首先来对插入排序有一个直观的认识,来自维基百科。 代码循环部分图示:代码:class Solution:# @p...
分类:编程语言   时间:2014-07-22 23:11:32    阅读次数:411
[leetcode]Reorder List @ Python
原题地址:http://oj.leetcode.com/problems/reorder-list/题意:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this...
分类:编程语言   时间:2014-05-01 15:37:03    阅读次数:441
Heroku installation
It is the first time that I use heroku. But I encountered some problems installing it. Luckily, I resolved the problem.(In windows 8)Step 1: Sign up.....
分类:其他好文   时间:2014-05-01 12:32:50    阅读次数:317
[leetcode]3Sum Closest @ Python
原题地址:http://oj.leetcode.com/problems/3sum-closest/题意:数组中每三个元素进行求和,找出所有和中大小最接近target的和,并返回这个和与target之间的差值。解题思路:使用一个变量mindiff来监测和与target之间的差值,如果差值为0,直接返...
分类:编程语言   时间:2014-04-29 16:37:46    阅读次数:432
Interleaving String -- LeetCode
原题链接: http://oj.leetcode.com/problems/interleaving-string/  这是一道关于字符串操作的题目,要求是判断一个字符串能不能由两个字符串按照他们自己的顺序,每次挑取两个串中的一个字符来构造出来。 像这种判断能否按照某种规则来完成求是否或者某个量的题目,很容易会想到用动态规划来实现。 先说说维护量,res[i][j]表示用s1的前i个字符和s...
分类:其他好文   时间:2014-04-29 13:46:22    阅读次数:336
Use UMDH to identify memory leak problem
We sometimes got memory leak problem, and we need to find the leaked memory, Here is a useful tool from MS, UMDH, it is included in WinDBG install package. Here is a introduction on how to UMDH to identify memory leak problems...
分类:其他好文   时间:2014-04-29 13:38:21    阅读次数:374
Restore IP Addresses -- LeetCode
原题链接: http://oj.leetcode.com/problems/restore-ip-addresses/  这道题的解法非常接近于NP问题,也是采用递归的解法。基本思路就是取出一个合法的数字,作为IP地址的一项,然后递归处理剩下的项。可以想象出一颗树,每个结点有三个可能的分支(因为范围是0-255,所以可以由一位两位或者三位组成)。并且这里树的层数不会超过四层,因为IP地址由四段组...
分类:其他好文   时间:2014-04-29 13:16:22    阅读次数:313
Reverse Linked List II -- LeetCode
原题链接: http://oj.leetcode.com/problems/reverse-linked-list-ii/  这道题是比较常见的链表反转操作,不过不是反转整个链表,而是从m到n的一部分。分为两个步骤,第一步是找到m结点所在位置,第二步就是进行反转直到n结点。反转的方法就是每读到一个结点,把它插入到m结点前面位置,然后m结点接到读到结点的下一个。总共只需要一次扫描,所以时间是O(n...
分类:其他好文   时间:2014-04-28 10:38:42    阅读次数:240
Subsets II -- LeetCode
原题链接: http://oj.leetcode.com/problems/subsets-ii/ 这道题跟Subsets一样是经典的NP问题--求子集。比Subsets稍微复杂一些的是这里的集合中可能出现重复元素,因此我们在求子集的时候要避免出现重复的子集。在Subsets中我们每次加进一个元素就会把原来的子集都加上这个元素,然后再加入到结果集中,但是这样重复的元素就会产生重复的子集。为了避免...
分类:其他好文   时间:2014-04-28 10:34:42    阅读次数:373
6275条   上一页 1 ... 625 626 627 628 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!