http://www.cnblogs.com/jiel/p/5852591.html 众所周知求一个图的哈密顿回路是一个NPC问题: In the mathematical field of graph theory, a Hamiltonian path (or traceable path) is a path in an undirected or directed graph that visits each vertex exactly once. A Hamiltonian cycl
题意:给你一个01矩阵,让你选择尽可能少的行数,使得这些行的并集能够覆盖到所有列. DLX算法求解重复覆盖问题模板,使用估价函数进行剪枝. #include<cstdio> #include<cstring> #include<vector> #include<algorithm> using namespace std; const int maxn=55+5; const int maxr=55+5; const int maxnode=55*55+5;
导读:今天看了java里面关于hashmap的相关源码(看了java6和java7),尤其是resize.transfer.put.get这几个方法,突然明白了,为什么我之前考数据结构死活考不过,就差那么一点点.答:代码积累太少了!这段时间,看了java的源码.演变过程等,被虐的很惨,但是,很开心! 本篇文章,主要介绍解决hash算法冲突的方法 一.基本概念 散列表: hash:a mixture of meat, potatoes, and vegetables cut into small