您正在查看 "Algorithm Contest" 分类下的文章
2011-05-08 1:30
导读:作者陈皓之前写过关于可视化排序的一篇文章,现在他又给大家罗列出可视化的数据结构和算法来供大家学习参考。文中分别从基础、索引、排序、动态编程等方面进行描述。
文章内容如下:

还记得之前发布过的那个 |
2011-05-05 23:58
发信人: qianbixin (铅笔芯)
如何用程序实现直线段去模拟a图中的离散曲线(各点值都已知),效果如图b
图a

图b

可能的解决方法有: 1 |
2010-06-15 1:46
求凸包, 然后用旋转卡壳求对踵点对,O(nlgn)
google "Rotating Caliper" |
2009-09-11 0:45
图(树)的遍历就不用说了。还有哪些呢?想起一点总结一点吧,欢迎补充。
DFS:
图的强联通分支分解
有向图的拓扑排序
汉诺塔的解
走迷宫问题
BFS:
汉诺塔的最优解
走迷宫的最优解
这里要注意的是,深度优先搜索亦称为纵向搜索。由于一个有解的问题树可能含有无穷分枝,深度优先搜索如果误入无穷分枝(即深度无限),则不可能找到目标节点。所以,深度优先搜索策略是不完备的。另外,应用此策略得到的解不一定是最 |
2009-08-09 3:34
TopCoder SRM 446 1000-Point Problem - HanoiTower
Problem Statement
|
| |
In this problem we consider a modification of the classical Hanoi Towers game. The rules of our modification are as follows:
| |
2009-07-21 1:26
A problem in Google code jam & its DP solution
Problem
The urban legend goes that if you go to the Google homepage and search for "Google", the universe will implode. We have a secret to share... It is true! Please don't try it, or tell anyone. All right, maybe not. We are just kidding.
The same is not true for a universe far far away. In that universe, if you se |
2009-07-21 0:56
Problem Statement 300'
|
| |
象形文字H[0],H[1],…,N[n-1]组成的长度为n的序列称为一个句子。如果句子中不存在两个下标i和j(0 <= i < j < n - 1),使得句子中的第i个元素H[i]和第j个元素H[j]是同一个象形文字,且H[i+1]和H[j+1]是不同的象形文字,那么这样 | |
2009-07-21 0:53
Problem Statement 250’
|
| |
M x N个点构成了一个矩形网格,M行N列。每个点是黑色或者白色。十字架由2个相交线段构成:垂直线段AB和水平线段CD,其中,A,B,C,D是不同的网格格点,点A和B不属于线段CD,点C和D不属于线段AB。设交点为E,一 | |
2009-06-27 2:39
最大子段间和的算法在《编程珠玑》上有现成的O(n)算法,如下:
maxsofar = 0
maxendinghere = 0
for i = [0, n)
/* invariant: maxendinghere and maxsofar are accurate
are accurate for x[0..i-1] */
maxendinghere = max(maxendinghere + x[i], 0)
maxsofar = max(maxsofar, maxendinghere)
书上并没有写如何求取区间的算法,这在微软的 |
2009-06-27 2:28