Redian新闻
>
求个父母赴美亲属关系公证书模板
avatar
求个父母赴美亲属关系公证书模板# Reunion - 探亲与陪读
z*g
1
Given a two dimensional graph with 6000 points on it, find a line which
passes the most number of points。
谢谢了。
avatar
g*j
2
包子感谢
avatar
l*r
3
hashtable, n^2..

【在 z**********g 的大作中提到】
: Given a two dimensional graph with 6000 points on it, find a line which
: passes the most number of points。
: 谢谢了。

avatar
r*o
4
what is the key and value of hashtable?

【在 l*******r 的大作中提到】
: hashtable, n^2..
avatar
m*g
5
好像据说for each point, calculate and hash the angle of any other point.
count the max on the same angle.
so O(n2)
avatar
r*o
6
how do you define the angle? slope? it is float.

【在 m*****g 的大作中提到】
: 好像据说for each point, calculate and hash the angle of any other point.
: count the max on the same angle.
: so O(n2)

avatar
a*9
7
这题好像本版见过。
就是对每两个点算slope和intersect,然后sort.
如果允许误差就直接把float sort,否则用分数表示。。

【在 z**********g 的大作中提到】
: Given a two dimensional graph with 6000 points on it, find a line which
: passes the most number of points。
: 谢谢了。

avatar
r*o
8
请问sort是对slope进行sort吗?

【在 a***9 的大作中提到】
: 这题好像本版见过。
: 就是对每两个点算slope和intersect,然后sort.
: 如果允许误差就直接把float sort,否则用分数表示。。

avatar
a*9
9
呃。。那还算intersect干嘛

【在 r****o 的大作中提到】
: 请问sort是对slope进行sort吗?
avatar
r*o
10
那是先对slope sort, 如果一样(误差小于给定值)再对intersect sort?

【在 a***9 的大作中提到】
: 呃。。那还算intersect干嘛
avatar
a*9
11
嗯,我想大概是这样的。。

【在 r****o 的大作中提到】
: 那是先对slope sort, 如果一样(误差小于给定值)再对intersect sort?
avatar
r*o
12
那复杂度是O(n^2lgn). 这题是不是不能用hash?

【在 a***9 的大作中提到】
: 嗯,我想大概是这样的。。
avatar
a*9
13
不是说好于O(n^3)就行了吗。。
我不知道能不能用hash,总觉得hash这种东西对算法题上比较扯。。
大概可以跟recruiter聊一聊是真的。。

【在 r****o 的大作中提到】
: 那复杂度是O(n^2lgn). 这题是不是不能用hash?
avatar
h*6
14
如果坐标都是整数的话,可以把求dy/dx最大公约数然后约分,hash或排序分母,分母
相同再比较分子。这样可以避免浮点数。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。