Professional Documents
Culture Documents
CUHK
April 6, 2010
Show the AVL-tree after inserting key 36.
40
15 73
10 30 60 80
3 20 35
Show the AVL-tree after deleting key 35.
30
15 40
10 20 35
3 25
Let S be a set of n horizontal segments, and P be a set of m
points, all in a 2d space. Give an algorithm to find, for each point
p ∈ P, the segment in S above it. Your algorithm should
terminate in O(n log n + m log m) time.
Example
s1
p1 s2
p3 s4 p4
p2
s3