Redian新闻
>
请教一个google的面试题
avatar
请教一个google的面试题# JobHunting - 待字闺中
u*7
1
find a intersection to build office so that the sum of all employees'
commute distances is minimum.. (the map is represented as a m*n grid, you
are given each employee's coordination, they can only move in up-down and
left-right directions)
这题目除了O(mn)的brute force做法外,还有什么更加高效的吗。
谢谢了
avatar
g*g
2
x mean y mean

【在 u**7 的大作中提到】
: find a intersection to build office so that the sum of all employees'
: commute distances is minimum.. (the map is represented as a m*n grid, you
: are given each employee's coordination, they can only move in up-down and
: left-right directions)
: 这题目除了O(mn)的brute force做法外,还有什么更加高效的吗。
: 谢谢了

avatar
w*i
3
如果是求最小的欧式距离平方和,取中点坐标一定正确,求导可证。不过如果求最小的
曼哈顿距离之和,取中点感觉不够严格啊。。。

【在 g*****g 的大作中提到】
: x mean y mean
avatar
r*c
4
这不是基本题目吗
avatar
h*k
5
中位数

★ 发自iPhone App: ChineseWeb 7.8

【在 u**7 的大作中提到】
: find a intersection to build office so that the sum of all employees'
: commute distances is minimum.. (the map is represented as a m*n grid, you
: are given each employee's coordination, they can only move in up-down and
: left-right directions)
: 这题目除了O(mn)的brute force做法外,还有什么更加高效的吗。
: 谢谢了

avatar
s*i
6
题目要求是曼哈顿距离啊,中位数正解。
avatar
g*n
7
哪位大神给具体讲讲呗
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。