码迷,mamicode.com
首页 >  
搜索关键字:the unique mst    ( 5979个结果
LeetCode Combination Sum
因为实验室项目好久没刷题了。从今天开始重新开始刷题。 Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers...
分类:其他好文   时间:2014-07-16 23:04:15    阅读次数:166
使用C++11新特性来实现RAII进行资源管理
方法一:借助auto、decltype、unique_ptr、Lambda表达式构造 sqlite3 *db = NULL; auto deleter = [](sqlite3 *pdb){sqlite3_close(pdb);} int nRet = sqlite3_open16(L"F:\\my...
分类:编程语言   时间:2014-07-16 22:59:07    阅读次数:385
LeetCode: Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each num...
分类:其他好文   时间:2014-07-16 19:53:49    阅读次数:238
ACdream 1135(MST-最小生成树边上2个值,维护第一个最小的前提下让另一个最小)
F - MST Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) SubmitStatus Problem Description Given a connected, undirected graph, a spanning tree of that graph...
分类:其他好文   时间:2014-07-12 17:42:21    阅读次数:199
【图论】信手拈来的Prim,Kruskal和Dijkstra
关于三个简单的图论算法prim,dijkstra和kruskal三个图论的算法,初学者容易将他们搞混,所以放在一起了。prim和kruskal是最小生成树(MST)的算法,dijkstra是单源最短路径的算法。prim最小生成树prim算法采用了贪心策略:把点分成两个集合,A为已被处理(已经在最小生...
分类:其他好文   时间:2014-07-12 00:34:01    阅读次数:216
#Leet Code# Unique Tree
语言:Python描述:使用递归实现 1 class Solution: 2 # @return an integer 3 def numTrees(self, n): 4 if n == 0: 5 return 0 6 eli...
分类:其他好文   时间:2014-07-11 23:44:08    阅读次数:216
[LeetCode] Combination Sum II
Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sum...
分类:其他好文   时间:2014-07-11 08:41:13    阅读次数:156
MySQL: ON DUPLICATE KEY UPDATE 用法
使用该语法可在插入记录的时候先判断记录是否存在,如果不存在则插入,否则更新,很方便,无需执行两条SQL  这个语句知识mysql中,而标准sql语句中是没有的。  INSERT INTO .. ON DUPLICATE KEY更新多行记录  如果在INSERT语句末尾指定了ON DUPLICATE KEY UPDATE,并且插入行后会导致在一个UNIQUE索引或PRI...
分类:数据库   时间:2014-07-11 08:24:56    阅读次数:289
POJ 2075 Tangled in Cables (c++/java)
给你一些人名,然后给你n条连接这些人名所拥有的房子的路,求用最小的代价求连接这些房子的花费是否满足要求。 附带C++ /JAVA实现...
分类:编程语言   时间:2014-07-11 08:21:41    阅读次数:214
【LeetCode】3Sum
3SumGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:El...
分类:其他好文   时间:2014-07-09 15:48:57    阅读次数:223
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!