Redian新闻
>
问一个Google Interview问题
avatar
问一个Google Interview问题# JobHunting - 待字闺中
T*8
1
Given a seria of points (Xi, Yi), find the line containing the highest
number of points from the list.
我反正没有好的方法
avatar
t*h
2
O(n^2)?

【在 T*****8 的大作中提到】
: Given a seria of points (Xi, Yi), find the line containing the highest
: number of points from the list.
: 我反正没有好的方法

avatar
T*8
3
we can find a solution with O(n^2). Is there a better solution?
avatar
l*i
4
O(n^2) how?
avatar
m*v
5
O(n^2 * logn) ?
avatar
T*8
6
for each pair of nodes, computer (a, b) and save it in harshtable... Count (
a, b)
avatar
e*s
7
就是两两求斜率,放到hashmap计数吗? O(n^2)
avatar
l*i
8
curious, what is your hash function? And how do you know the number of
collision is O(1)
avatar
g*e
9
for each pair, compute y=kx+b -> k, b, hash key is (k,b) pair, hash value is
node(s).
avatar
Y*3
10
这个就是Hough transform 嘛
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。