由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个careercup上面的题目
相关主题
亚马逊电话面经这里有懂business intelligence development的同学吗?
Palantir面经谁能给个小于n^3的算法
delete mininum characters to make string as panlindromeAnother interview problem ~
Interview Question- Algorithm一个c++ 题目
Leetcode上stack相关的题目相比CC150题怎么那么少?Longest Valid Parentheses问个题目,好像以前有人问过~~~
急问有没有面试过bloomberg的senior calculations programmer的?BB试题:如何创建2D array of String?
about how to test a calculator program on computer顶风作案,Google面经
分享一道trading firm的code screen,只能用c++问道150上的递归题?
相关话题的讨论汇总
话题: points话题: maxp话题: pj话题: lmax话题: line
进入JobHunting版参与讨论
1 (共1页)
s*****y
发帖数: 897
1
1.10 Given a two dimensional graph with 6000 points on it, find a line which
passes the most number of points.
Basic Idea: We need two points to define a line. So, for all possible lines,
check which has the max number of points passing though. Let’s say there
are N points, and P is the set of all points.
Algorithm:
Lmax = 0, Maxp=0 for all pairs of point (Pi,Pj) in P
calculate number of points m passing through the line L(P1,Pj) if (m > Maxp)
{
Maxp = m; Lmax = L(Pi,Pj);
} return Lmax;
Time complexity is O(N^3) because calculating the number of points on the
query line is yet another pass through the set.
看不懂答案,有懂的可以说说吗? 谢谢。
1 (共1页)
进入JobHunting版参与讨论
相关主题
问道150上的递归题?Leetcode上stack相关的题目相比CC150题怎么那么少?Longest Valid Parentheses
急需:SAS developer急问有没有面试过bloomberg的senior calculations programmer的?
非典型面试题about how to test a calculator program on computer
借宝地问个面试中的sql的问题。分享一道trading firm的code screen,只能用c++
亚马逊电话面经这里有懂business intelligence development的同学吗?
Palantir面经谁能给个小于n^3的算法
delete mininum characters to make string as panlindromeAnother interview problem ~
Interview Question- Algorithm一个c++ 题目
相关话题的讨论汇总
话题: points话题: maxp话题: pj话题: lmax话题: line