码迷,mamicode.com
首页 >  
搜索关键字:unique paths ii    ( 12050个结果
Problem Path Sum II
Problem Description:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.Solution: 递归。 1 public List>...
分类:其他好文   时间:2014-07-07 16:59:12    阅读次数:169
LeetCode::Remove Duplicates from Sorted List II [具体分析]
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2-...
分类:其他好文   时间:2014-07-07 16:17:00    阅读次数:139
leetcode - Linked List Cycle II
题目:Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it withou...
分类:其他好文   时间:2014-07-07 13:44:29    阅读次数:281
Codeforces 14D Two Paths 树的直径
题目链接:点击打开链接 题意:给定一棵树 找2条点不重复的路径,使得两路径的长度乘积最大 思路: 1、为了保证点不重复,在图中删去一条边,枚举这条删边 2、这样得到了2个树,在各自的树中找最长链,即树的直径,然后相乘即可 #include #include #include #include #include #include #include #include #include #i...
分类:其他好文   时间:2014-06-30 07:30:01    阅读次数:235
N-Queens II
题目 Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 方法 和上题方法一样,使用回溯法,结构基本相同,只需要返回数量。 public i...
分类:其他好文   时间:2014-06-30 06:24:22    阅读次数:273
LeetCode: Word Break II [140]
【题目】 Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences. For example, given s = "catsanddog", dict = ["cat", "cats", "and", "sand", "dog...
分类:其他好文   时间:2014-06-30 00:51:41    阅读次数:295
给树莓派IIraspberrypi安装emacs+ecb+cedet+session+color-theme+cscope+linum
还是在2008~2010年的时候,比较粉Emacs,然后花了很多时间在上面,编程效率的确高了,但是在上面花的时间也不少。2010年底的时候,放弃Emacs,而是选用所有支持emacs key的IDE,比如Eclipse,NetBean,VS等,说到底Emacs的编程效率最主要就体现在emacs key上,而直接用Emacs的话,各种插件的版本冲突解决和配置要花开发人员不少时间,而使用现代IDE,既能享受emacs key的快捷,又能省去Emacs配置和麻烦,何乐而不为。 但是最近在树莓派II上开发一些嵌入...
分类:Web程序   时间:2014-06-30 00:22:57    阅读次数:398
LeetCode: Linked List Cycle II [142]
【题目】 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? 【题意】 给定一个单向链表,如果链表有环,则返回环开始的位置。 【思路】 仍然是维护两个指针, p1, p2, p1每次走一步, p2每次走两步 ...
分类:其他好文   时间:2014-06-29 23:59:21    阅读次数:354
leetCode: Single Number II [137]
【题目】 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 【题意】 给定一个整数以外,其中除了一个整数只出现一次以外...
分类:其他好文   时间:2014-06-29 22:52:35    阅读次数:246
leetcode--Longest Palindromic Substring
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:其他好文   时间:2014-06-29 20:28:58    阅读次数:183
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!