码迷,mamicode.com
首页 >  
搜索关键字:the unique mst    ( 5979个结果
[leetcode]Unique Binary Search Trees II @ Python
原题地址:https://oj.leetcode.com/problems/unique-binary-search-trees-ii/题意:接上一题,这题要求返回的是所有符合条件的二叉查找树,而上一题要求的是符合条件的二叉查找树的棵数,我们上一题提过,求个数一般思路是动态规划,而枚举的话,我们就考...
分类:编程语言   时间:2014-05-26 18:30:01    阅读次数:256
【LeetCode】Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated num...
分类:其他好文   时间:2014-05-26 13:54:25    阅读次数:282
HITAG 2 125kHz RFID IC Read-Write 256 bits
Features 256 bits EEPROM memory organized in 8 pages of 32 bits each 32 bits unique factory programmed serial number Typical operating frequency : ...
分类:其他好文   时间:2014-05-26 13:32:43    阅读次数:287
LeetCode:4Sum
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 whic...
分类:其他好文   时间:2014-05-26 09:42:30    阅读次数:209
【leetcode】Unique Paths II
题目:与版本一不同的是,这里给定了一个矩阵,矩阵中元素为0的点表示该点可达,为1的点表示不可达,当然,不可达也就意味着不可经过。以左上角为出发点,右下角为目标终点,可行的不同路径有多少。 分析: 在Uniqu Paths I 的基础上,加上对矩阵可达性的判断就可以了。 注意: 1.左上角的元素是1的时候,即出发点就不可达,即出发不了,倒在了起跑线上。 2.给定的矩阵是1*1的形式。 3...
分类:其他好文   时间:2014-05-26 05:48:24    阅读次数:247
月球美容计划之最小生成树(MST)
寒假学的两个算法,普里姆,克鲁斯卡尔终于弄明白了,可以发总结了 先说说普里姆,它的本质就是贪心,先从任意一个点开始,找到最短边,然后不断更新更新len数组,然后再选取最短边并标记经过的点,直到所有的点被标记,或者说已经选好了n-1条边。 克鲁斯卡尔,一个排序一个并查集只是表面,实质还是贪心,只不过普里斯是任选一个点选最短路,而克鲁斯卡尔是看全局,全体边排序,当然,因为排序,导致时间复杂度不容易降下来。 拿SDUTOJ2144为例,代码如下,可做模板...
分类:其他好文   时间:2014-05-25 11:10:47    阅读次数:256
LeetCode: Permutation Sequence [059]
【题目】 The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3): "123" "132" "213" "231" "312" "321" Given n and k, return the kth permutation ...
分类:其他好文   时间:2014-05-25 06:13:37    阅读次数:276
LeetCode:3Sum
题目:         Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique  triplets in the array which gives the sum of zero. Note: Elements...
分类:其他好文   时间:2014-05-25 00:39:37    阅读次数:343
Unique Paths
题目:给定一个由参数m,n表示行数和列数而形成的2维表格,以左上为出发点,右下为目的地,每次只能向右走一步,或者向下走一步,算出总共存在多少不同的到达路径。 分析;这个问题的递归属性是很明显的,因为无论向右走还是向下走,到达一个新的位置,这时就变成了在该新位置到达目的地有多少不同的路径。其次,向右走和向下走是不同的路径,最终的结果应该是二者的和。 递归的返回条件:n = 1 或 m = 1, ...
分类:其他好文   时间:2014-05-24 21:58:45    阅读次数:243
mysql基础操作、sql技巧和sql的常见优化
一、常见操作 1、复制表结构create table t2 like t1    复制表数据insert into t2 select * from t1 2、mysql索引    alter table用来创建普通索引、unique索引或primary key索引    alter table t add index index_name(column_list)    al...
分类:数据库   时间:2014-05-24 14:43:02    阅读次数:363
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!