码迷,mamicode.com
首页 >  
搜索关键字:visit    ( 1001个结果
[LeetCode] Binary Tree Paths
The basic idea is to start fromrootand add it to the currentpath, then we recursively visit itsleftandrightsubtrees if they exist; otherwise, we have ...
分类:其他好文   时间:2015-08-16 11:58:51    阅读次数:248
二叉树的后续遍历算法实现
1 // 递归算法 2 template 3 void postOrder(void (*visit)(BinTreeNode* t), BinTreeNode* root) 4 { 5 if (root != NULL) { 6 postOrder(visit, roo...
分类:编程语言   时间:2015-08-15 11:32:40    阅读次数:235
poj3181(Dollar Dayz)
Description Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer...
分类:其他好文   时间:2015-08-14 17:12:34    阅读次数:111
hdu 1429 bfs+状态压缩
对于这类需要钥匙才能通过的迷宫来说,一般visit数组会开成三维的:bool visit[N][N][1 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 const int N =...
分类:其他好文   时间:2015-08-14 15:34:36    阅读次数:131
ajax 中关于URL路径及参数特殊字符问题
最近在做项目时,ajax参数中出现了特殊字符(#)导致路径出现截断问题,去度娘找了下答案,找到了解决办法,在js中有个:escape() 函数 看下函数介绍 escape() 函数可对字符串进行编码,这样就可以在所有的计算机上读取该字符串。 例子 document.write(escape("Visit W3School!") + "") document.write(escape(...
分类:Web程序   时间:2015-08-13 18:12:26    阅读次数:172
HDU 2680 Choose the best route(dijkstra+优先队列优化)
Choose the best routeProblem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her...
分类:其他好文   时间:2015-08-12 23:00:14    阅读次数:119
二叉树后序遍历的非递归算法(C语言)
首先非常感谢‘hicjiajia’的博文:二叉树后序遍历(非递归)这篇随笔开启我的博客进程,成为万千程序员中的一员,坚持走到更远!折磨了我一下午的后序遍历中午得到解决,关键在于标记右子树是否被访问过,考虑过修改二叉树结点的数据结构,增加一个visit域,或者建一个栈存储已访问的结点。都比较麻烦没有调...
分类:编程语言   时间:2015-08-11 20:59:51    阅读次数:147
HDU 2603 二分匹配
#include #include #include #include #include #include using namespace std;const int N = 510;int maps[N][N], visit[N], used[N];int n, m;bool Find(int u...
分类:其他好文   时间:2015-08-08 10:28:43    阅读次数:106
uva 1378博弈
算得上是一个比较复杂的游戏了,解法见论文《解析一类组合游戏》,需要注意的是visit数组要适当开大点防止溢出。 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int N = 25; 7 int a[N]; ...
分类:其他好文   时间:2015-08-07 13:16:40    阅读次数:89
迷宫问题
1 #include 2 #include 3 #include 4 using namespace std; 5 int step,t; 6 int visit[25]; 7 int map[25]; 8 int pre[26]; 9 int disx[4]={0,1,0,-1};10 int ....
分类:其他好文   时间:2015-08-06 13:11:37    阅读次数:89
1001条   上一页 1 ... 75 76 77 78 79 ... 101 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!