由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - G家面试题请教
相关主题
问个面试题算法面试题
请问一道google面试题求机械高手帮忙,压过老印 (转载)
M家问题Cleaning Robot 算法请教
G家一道面试题求问G家面经
obstacle avoidance的问题有解吗?rejected by facebook after 2nd phone interview
G题求解迷津请教一道google面试题
攒人品,google电话面经今天1/9 Amazon onsite,当天晚上收到offer,上面筋
看到个面试题,不会做……leetcode number of islands为什么不能用BFS?
相关话题的讨论汇总
话题: 障碍物话题: bfs话题: grid话题: obstacles话题: 面试题
进入JobHunting版参与讨论
1 (共1页)
j*********n
发帖数: 34
1
1.
Given multiple printers on a grid map, find the location to place papers
such that the sum of distance from the
paper to all printers is minimal; note that there are obstacles in the grid
map. What if there is no obstacles?
2
2d array *代表障碍物 #代表货物 空白就是正常的路

如何找到一个点为出发点 能实现总共取货路径最短? 每次只能拿一个货物,遇到障碍
需要绕开,拿到以后要放回出发点,然后再取另一个
******
* # *
* *** *
* *
* ** *
* # #*
** ****
如果没有障碍物,就是曼哈顿最短距离,http://stackoverflow.com/questions/10402087/algorithm-for-minimum-manhattan-distance,如果有障碍物,什么算法比较好? 大牛请解惑
P*******L
发帖数: 2637
2
2 用 BFS?

grid

【在 j*********n 的大作中提到】
: 1.
: Given multiple printers on a grid map, find the location to place papers
: such that the sum of distance from the
: paper to all printers is minimal; note that there are obstacles in the grid
: map. What if there is no obstacles?
: 2
: 2d array *代表障碍物 #代表货物 空白就是正常的路
: 问
: 如何找到一个点为出发点 能实现总共取货路径最短? 每次只能拿一个货物,遇到障碍
: 需要绕开,拿到以后要放回出发点,然后再取另一个

j*********n
发帖数: 34
3
1和2其实是一样的题,都有在有障碍物的情况下,求一点到其他已知点的最小距离。
BFS肯定是用BFS, 但BFS怎么做好呢? 比如第2题,一种方法对所有 '#‘做BFS,另一
种方法是从所有空白格做BFS. 不过都不efficient, 有什么好办法吗?

【在 P*******L 的大作中提到】
: 2 用 BFS?
:
: grid

l****i
发帖数: 2772
4
从货物出发去BFS
x******0
发帖数: 178
5
有障碍物,用BFS 算每个点到所有打印机/货物的距离和?这不是标准的brute force么
。。
1 (共1页)
进入JobHunting版参与讨论
相关主题
leetcode number of islands为什么不能用BFS?obstacle avoidance的问题有解吗?
找距离在一定范围之内的(比如1mile, 25 mile, 50 mile)的点(friends, stores, etc)G题求解迷津
一道面试题攒人品,google电话面经
问一道少见的微软面试题。看到个面试题,不会做……
问个面试题算法面试题
请问一道google面试题求机械高手帮忙,压过老印 (转载)
M家问题Cleaning Robot 算法请教
G家一道面试题求问G家面经
相关话题的讨论汇总
话题: 障碍物话题: bfs话题: grid话题: obstacles话题: 面试题