Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have
the following unique permutations:
[1,1,2], [1,2,1],
and [2,1...
分类:
其他好文 时间:
2014-08-11 17:49:32
阅读次数:
201
操作系统:Win7 64 bit开发环境:Quartus II 12.0 (64-Bit) +Nios II 12.0 Software Build Tools for Eclipse使用Quartus 时,有时候出于备份的考虑,或者从网上下载别人的硬件工程,硬件工程目录会改变,导致NIOS工程不能...
分类:
移动开发 时间:
2014-08-11 17:17:02
阅读次数:
531
leetcode上有两个关于n皇后的问题,两个题目基本是一样的,只是第二个是把所有的排法求出来。n皇后最简单的就是用递归,每次判断一行的一个位置,如果合法,就判断下一行,不合法再判断下一个位置
N-Queens II
Follow up for N-Queens problem.
Now, instead outputting board configuration...
分类:
其他好文 时间:
2014-08-11 15:06:12
阅读次数:
227
参考文献:http://blog.csdn.net/lanxu_yy/article/details/17848219 不过本文准备用超链接的方式连接到相应解答页面,不断更新中
题目
算法
数据结构
注意事项
Clone Graph
BFS
哈希表
Word Ladder II
BFS
哈希表
Surrounded Regions...
分类:
其他好文 时间:
2014-08-11 08:27:51
阅读次数:
238
链接:http://acm.hdu.edu.cn/showproblem.php?pid=2121
题意:n个顶点,m条边,求从某一点起建立有向图最小生成树并且花费最小,输出最小花费和根节点下标。
思路:这道题根是不确定的,我们可以先假设一个根,从这个根出发到任何一点的距离(sum)都比原图总权值还大,这样保证了虚拟的边不会是最小入边,也为之后判断是否生成了最小树形图提供方便,从这个点...
分类:
其他好文 时间:
2014-08-10 18:45:40
阅读次数:
271
A so juicy and interesting problem! Recommend to everyone!A final solution may not jump into your mind immediately, of course, DP is not a trivial top...
分类:
其他好文 时间:
2014-08-10 15:37:00
阅读次数:
209
给定一个二叉树和数字sum,输出二叉树中从根节点到叶子节点所有路径中和等于sum的路径。...
分类:
其他好文 时间:
2014-08-10 13:08:10
阅读次数:
204
题目大意:
给出的矩阵每一列之间可以任意交换。
求出交换后得到的最大的子矩阵和。
思路分析:
height[i][j] 表示 位置 i j 往下有多少深度。
然后我们枚举每一行。
可以将所有的height 排序。
得到最大的矩阵和就一遍递推过去。
n*n*lgn。。。
#include
#include
#include
#include
#define ...
分类:
移动开发 时间:
2014-08-10 10:29:10
阅读次数:
230
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
原题链接:https://oj...
分类:
其他好文 时间:
2014-08-10 10:25:50
阅读次数:
265
说明: 深度搜索,一定要记忆下每次走完的结果(此处记下筛掉的情况)。
说明: 方法比较巧妙。记忆下每个位置开始的所有能成回文串的结束位置。然后深搜。
分类:
其他好文 时间:
2014-08-10 03:54:29
阅读次数:
284