码迷,mamicode.com
首页 >  
搜索关键字:the unique mst    ( 5979个结果
Unique Paths II <leetcode>
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i...
分类:其他好文   时间:2014-09-16 10:38:30    阅读次数:236
并查集
并查集(不相交集合) 文章作者:ktyanny 文章来源:ktyanny 早上早早起来看Kruscal的MST算法,原来要用到不相交集合来实现。拿起《算法导论》看完不相交集合这章,顿然茅塞顿开,终于完成并查集的基础知识的学习。《算法导论》真是牛×× 不相交集合有两种不同的实现,链表表示和带路...
分类:其他好文   时间:2014-09-15 00:55:37    阅读次数:220
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-09-14 12:49:37    阅读次数:214
dataguard 归档丢失(主库中无此丢失归档处理),备库基于SCN恢复
dataguard 归档丢失(主库中无此丢失归档处理),备库基于SCN恢复环境:OS: CentOS 6.5DB: Oracle 10.2.0.5 1.主备库环境主库:SQL> select dbid,name,LOG_MODE,open_mode,db_unique_name,DATABASE_R...
分类:其他好文   时间:2014-09-13 22:45:46    阅读次数:343
[leetcode]4Sum
[leetcode]Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target....
分类:其他好文   时间:2014-09-13 13:25:25    阅读次数:180
leetCode系列----Unique Paths II
leetcode 的图路径数目问题...
分类:其他好文   时间:2014-09-12 19:11:56    阅读次数:176
3Sum and 4Sum @ Python Leetcode
1)3Sumhttps://oj.leetcode.com/problems/3sum/Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the a...
分类:编程语言   时间:2014-09-12 11:38:13    阅读次数:298
LeetCode-- Unique Binary Search Trees II
递归 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode...
分类:其他好文   时间:2014-09-12 11:36:23    阅读次数:183
UVA 1494 - Qin Shi Huang's National Road System(MST)
UVA 1494 - Qin Shi Huang's National Road System 题目链接 题意:秦始皇修路,要求所有道路连通,现在道士徐福可以用法术修一条路,问现在用法术修路的两边的人口数A,除以总修路长度B的最大值A/B是多少 思路:先求出最小生成树,然后利用dfs找出每两点之间的最大权的边的权值,然后在枚举哪两个城市需要法术修路,这样就可以记录下答案最大值 ...
分类:其他好文   时间:2014-09-11 17:24:02    阅读次数:220
print all unique solution to split number n
print all unique solution to split number n, given choice of 1 3 5 10for example if n is 4{1, 1, 1, 1}{1, 3}思路:用DFS肯定可以求解,但需要遍历所有可能,进行剪纸之后用递推实现。主要剪枝思想...
分类:其他好文   时间:2014-09-10 19:27:20    阅读次数:144
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!