由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 请教一道面试题,判断迷宫有没有解
相关主题
G题求解迷津贡献A家面经
graph如何找最短路径?问一个word ladder的题目
请问一道google面试题Palantir面经
问个google的面试题。问一道Apple电话面试题
search 一問 DFS刚开始找工作,算法要看什么书啊?
MS面试题赞人品,也发Twitter 电面面经,又挂了!!(add Amazon 1st phone interview 面经)
[算法] word ladder problem带限制条件的最短路径题怎么做?
请问一道题shortest path in matrix
相关话题的讨论汇总
话题: maze话题: give话题: 迷宫话题: algorithm话题: 判断
进入JobHunting版参与讨论
1 (共1页)
A*********3
发帖数: 70
1
请问判断一个迷宫有没有解,除了BFS, DFS,递归调用,还有什么别的办法吗?非常感
谢!
g*********s
发帖数: 1782
2
it depends on the problem. there's no general answer.

【在 A*********3 的大作中提到】
: 请问判断一个迷宫有没有解,除了BFS, DFS,递归调用,还有什么别的办法吗?非常感
: 谢!

A*********3
发帖数: 70
3
恩,就是最常见的那种迷宫,二维数组表示的,0表示路,1表示墙。
判断有没有解
g*********s
发帖数: 1782
4
please be more specific.

【在 A*********3 的大作中提到】
: 恩,就是最常见的那种迷宫,二维数组表示的,0表示路,1表示墙。
: 判断有没有解

a****n
发帖数: 1887
5
BFS/DFS with mark table
A*********3
发帖数: 70
6
Give a maze, represented by an int array maze[][]
for example
0 1 0 0 0
1 1 1 0 0
1 0 1 1 1
0 0 0 0 1
1 1 1 1 1
0 is passage, 1 is wall
please give an algorithm to design if the maze is solvable or not
g*********s
发帖数: 1782
7
construct a graph and solve shortest path b/w entry and exit.

【在 A*********3 的大作中提到】
: Give a maze, represented by an int array maze[][]
: for example
: 0 1 0 0 0
: 1 1 1 0 0
: 1 0 1 1 1
: 0 0 0 0 1
: 1 1 1 1 1
: 0 is passage, 1 is wall
: please give an algorithm to design if the maze is solvable or not

j*****u
发帖数: 1133
8
A* search
http://en.wikipedia.org/wiki/A*_search_algorithm

【在 A*********3 的大作中提到】
: 请问判断一个迷宫有没有解,除了BFS, DFS,递归调用,还有什么别的办法吗?非常感
: 谢!

r****o
发帖数: 1950
9
DP也可以吧。

【在 a****n 的大作中提到】
: BFS/DFS with mark table
h**6
发帖数: 4160
10
A*本质上还是Dijkstra
这题里面所有边长都为1,可以简化题目,不必使用优先队列,而用一个普通队列完成
遍历。

【在 j*****u 的大作中提到】
: A* search
: http://en.wikipedia.org/wiki/A*_search_algorithm

b*****e
发帖数: 474
11
如果只要判断有无解的话,用个 Disjoint Set 就够了。
1 (共1页)
进入JobHunting版参与讨论
相关主题
shortest path in matrixsearch 一問 DFS
求问:游戏中比较自然的路径寻找算法有啥简单方案? (转载)MS面试题
Rocket Fuel面经[算法] word ladder problem
面试复习总结请问一道题
G题求解迷津贡献A家面经
graph如何找最短路径?问一个word ladder的题目
请问一道google面试题Palantir面经
问个google的面试题。问一道Apple电话面试题
相关话题的讨论汇总
话题: maze话题: give话题: 迷宫话题: algorithm话题: 判断