由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - CLRS interval tree 的两道练习题
相关主题
微软校园面试总结求overlap的rectagales
find the number of rectangles that intersected问道G题(2)
面经加求建议发道面经攒人品
Google Onsite Interview问一道flg面试题
请教大家一道Google的题目怎么求contour of overlapping rectangles
请问一道面试题Maximal Rectangle TLE是指代码正确,但不是最优吗?
请教一个Axis-Aligned Rectangles的算法从 topcoder 搬来一个问题,看看大家有什么想法
问个老算法题面试遇到扫描线算法和interval tree 问题怎么办
相关话题的讨论汇总
话题: rectangles话题: interval话题: tree话题: rectangle话题: overlap
进入JobHunting版参与讨论
1 (共1页)
s**x
发帖数: 7506
1
14.3-4
given an interval tree T and interval i, describe how all intervals in T
that overlap i can be listed in O(min(n, klogn)) time, where k is the number
of intervals in the output list. (optional: find a solution that does not
modify the tree)
14.3-7
VLSI databases commonly represent an intergrated circuit as a list of
rectangles, assume that each rectangle is rectilinearly oriented(side
parallel to the x- and y-axis), so that a representation of a rectangle
consists of its minimum and maximum x, y coordinates. given an O(nlogn)-time
algorithm to decide where or not a set of rectangles so represented
contains two rectangles that overlap. your algorithm need not report all
intersecting pairs, but it must report that an overlap exist if one
rectangle entirely covers another, even if the boudary lines do not
intersect. (Hint: move a "sweep" line accross the set of rectangles.)
谁说说怎么做?
多谢!
f**********t
发帖数: 1001
2
关注一下。
google的Interval问题考察的是不是这个?
如:
Assume we have n people. Each one has a starting time and ending
time. For any people, set flag to true if his/her time range overlaps
with anyone else's.
s**x
发帖数: 7506
3
not really. for this one, there is a better way.
discussed before and also on the web. the idea is split each pair and then
sort all the numbers and the walk through the list.
thinking about lost of "()", if will be nested if there is a overlap. O(
nlogn).

【在 f**********t 的大作中提到】
: 关注一下。
: google的Interval问题考察的是不是这个?
: 如:
: Assume we have n people. Each one has a starting time and ending
: time. For any people, set flag to true if his/her time range overlaps
: with anyone else's.

F**r
发帖数: 84
4
14.3-4 is straightforward, directly utilize the properties of interval tree.
14.3-7 straightforward too, apply interval tree in 2-D respectively.

number
time

【在 s**x 的大作中提到】
: 14.3-4
: given an interval tree T and interval i, describe how all intervals in T
: that overlap i can be listed in O(min(n, klogn)) time, where k is the number
: of intervals in the output list. (optional: find a solution that does not
: modify the tree)
: 14.3-7
: VLSI databases commonly represent an intergrated circuit as a list of
: rectangles, assume that each rectangle is rectilinearly oriented(side
: parallel to the x- and y-axis), so that a representation of a rectangle
: consists of its minimum and maximum x, y coordinates. given an O(nlogn)-time

d*******d
发帖数: 2050
5
2,先把所有的x坐标拿出来排个序,然后在y坐标上建interval tree,scanline从左往右,
每次touch rectangle left的时候,放入y1-y2到tree,同时看有没有重叠,touch到
rectangle右边的时候,拿掉.

tree.

【在 F**r 的大作中提到】
: 14.3-4 is straightforward, directly utilize the properties of interval tree.
: 14.3-7 straightforward too, apply interval tree in 2-D respectively.
:
: number
: time

s**x
发帖数: 7506
6
14.3-4, any details?

tree.

【在 F**r 的大作中提到】
: 14.3-4 is straightforward, directly utilize the properties of interval tree.
: 14.3-7 straightforward too, apply interval tree in 2-D respectively.
:
: number
: time

1 (共1页)
进入JobHunting版参与讨论
相关主题
面试遇到扫描线算法和interval tree 问题怎么办请教大家一道Google的题目
今早的G电面,郁闷坏了...请问一道面试题
问一道G家面试题请教一个Axis-Aligned Rectangles的算法
问个算法题, 关于区间 overlap的问个老算法题
微软校园面试总结求overlap的rectagales
find the number of rectangles that intersected问道G题(2)
面经加求建议发道面经攒人品
Google Onsite Interview问一道flg面试题
相关话题的讨论汇总
话题: rectangles话题: interval话题: tree话题: rectangle话题: overlap