BFS
i-Blue
抱平常心走平常路
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
POJ2251-Dungeon Master-BFS
题目大意: 一个立体空间, 输入三个数,L,R,C,代表有L个平面,R行,C列,.代表可以走,#代表不能走,S代表开始点,E代表结束点,问从S开始走,对每个位置,有六个走法,即空间的六个方向的走法(上下东南西北),一分钟可以走一个点,问从S走到E点,最少可以经过多少分钟,若不能到达,则输出Trapped!使用BFS。队列用单链表形式(也可以用数组来表示,但要指定足够长原创 2016-05-15 16:54:32 · 387 阅读 · 0 评论 -
101. Symmetric Tree--DFS(递归)/BFS(queue+迭代)
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3原创 2016-11-02 17:44:33 · 548 阅读 · 0 评论
分享