CS 373U
Homework 6 (Practice only)
Spring 2004
1. Let
P
be a set of
n
points in the plane. Recall that a point
p
∈
P
is
Paretooptimal
if no other
point is both above and to the right of
p
. Intuitively, the sorted sequence of Paretooptimal
points describes a
staircase
with all the points in
P
below and to the left. Your task is to
describe some algorithms that compute this staircase.
The staircase of a set of points
(a) Describe an algorithm to compute the staircase of
P
in
O
(
nh
) time, where
h
is the
number of Paretooptimal points.
(b) Describe a divideandconquer algorithm to compute the staircase of
P
in
O
(
n
log
n
)
time.
[Hint: I know of at least two diFerent ways to do this.]
⋆
(c) Describe an algorithm to compute the staircase of
P
in
O
(
n
log
h
) time, where
h
is the
number of Paretooptimal points.
[Hint: I know of at least two diFerent ways to do this.]
(d) Finally, suppose the points in
P
are already given in sorted order from left to right.
Describe an algorithm to compute the staircase of
P
in
O
(
n
) time.
[Hint: I know of at
least two diFerent ways to do this.]
2. Let
R
be a set of
n
rectangles in the plane.
(a) Describe and analyze a plane sweep algorithm to decide, in
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 Chekuri,C
 Sort, Ghostbusters, plane sweep algorithm, Egon Spengler, Ghostbusters II, Dr. Egon Spengler

Click to edit the document details