由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 求overlap的rectagales
相关主题
面试遇到扫描线算法和interval tree 问题怎么办问一个算法题
请教大家一道Google的题目这题咋做?
请问一道面试题一道面试题, 挺难的, 求助
请教一个Axis-Aligned Rectangles的算法臭名昭著的skyline问题
问道G题(2)求问twitter电面
微软校园面试总结问个google面经题
怎么求contour of overlapping rectangles大家来讨论一下这个求长方形面积的问题吧
Google onsite interview questions算法--一个MXN matrix (0's and 1's)内求最大 rectangle(1's)
相关话题的讨论汇总
话题: axis话题: rectagales话题: rectangles话题: rectangle话题: overlap
进入JobHunting版参与讨论
1 (共1页)
J*Y
发帖数: 81
1
Describe an algorithm that takes an unsorted array of axis‐aligned
rectangles and returns any pair of rectangles that overlaps, if there is
such a pair. Axis‐alignedmeans that all the rectangle sides are either
parallel or perpendicular to the x‐ and
y‐axis. You can assume that each rectangle object has two variables in it:
the x‐y coordinates of the upper‐left corner and the bottom‐right corner.
P*******U
发帖数: 203
2
判断相交有4种case,比较麻烦,不如直接判断不相交,很trivial。如果判断不相交的
函数返回false,那就是香蕉了
b***u
发帖数: 12010
3
我也见到这题了。出题的真缺德啊。

corner.

【在 J*Y 的大作中提到】
: Describe an algorithm that takes an unsorted array of axis‐aligned
: rectangles and returns any pair of rectangles that overlaps, if there is
: such a pair. Axis‐alignedmeans that all the rectangle sides are either
: parallel or perpendicular to the x‐ and
: y‐axis. You can assume that each rectangle object has two variables in it:
: the x‐y coordinates of the upper‐left corner and the bottom‐right corner.

l***i
发帖数: 1309
4
sweep line algorithm can do O(nlogn), or you can brute force to try all O(n^
2) pairs to check intersection.
H***e
发帖数: 476
5
hack goog interview上面有答案
http://courses.csail.mit.edu/iap/interview/Hacking_a_Google_Int
不过我也没看懂
binary tree节点里存的是什么?
1 (共1页)
进入JobHunting版参与讨论
相关主题
算法--一个MXN matrix (0's and 1's)内求最大 rectangle(1's)问道G题(2)
leetcode container with most water微软校园面试总结
leetcode一道题怎么求contour of overlapping rectangles
Maximal Rectangle如果不要求是Rectangle就要简单得多Google onsite interview questions
面试遇到扫描线算法和interval tree 问题怎么办问一个算法题
请教大家一道Google的题目这题咋做?
请问一道面试题一道面试题, 挺难的, 求助
请教一个Axis-Aligned Rectangles的算法臭名昭著的skyline问题
相关话题的讨论汇总
话题: axis话题: rectagales话题: rectangles话题: rectangle话题: overlap