This preview shows pages 1–2. Sign up to view the full content.
Problem 1.
A Dynamic Set
A dynamic set
Q
contains items, where each item
x
has an associated key
key
[
x
]
. The dynamic set
Q
supports the following operations:
•
I
NSERT
(
x,
Q
)
: Insert item
x
into
Q
.
•
x
∈
E
XTRACT
O
LDEST
(
Q
)
: Remove and return the oldest item
x
≤
Q
. (The oldest item is
the one inserted least recently.)
•
x
∈
F
IND
M
AX
(
Q
)
: Return (but do not remove) the item
x
≤
Q
for which
key
[
x
]
is maximal.
Design a data structure for
Q
that can perform any sequence of
n
operations efﬁciently.
Problem 2.
Great Minds Need Coffee
It is a beautiful autumn morning, and Professor Indyk has decided to walk from his apartment to
MIT where he will give a lecture for 6.046. To prepare for this trip, the professor has gone online
and downloaded a map of the
n
roads and
m
intersections in the Boston area. For each road
e
connecting two intersections, the map lists the length
w
[
e
] of the road in meters. (Recall that in
the Boston area, an arbitrarily large number of roads can meet at a single intersection, e.g., Davis
Square.)
Like many great theorists, Professor Indyk cannot walk more than 1000 meters without sitting
down and assuaging his caffeine addiction. (This is especially true before 9:30 A.M.) Fortunately,
the Moonbucks Coffee Company has recently opened a large number of coffee shops throughout
the Boston area. Let
B =
{
b1, b2, . . . , bk
} be the set of
k
intersections hosting Moonbucks coffee
shops.
Thus, Professor Indyk is looking for a route from his apartment (located at one given intersection)
to the Stata Center (located at another given intersection) in which he never travels more than 1000
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.
This note was uploaded on 01/20/2012 for the course CS 6.006 taught by Professor Erikdemaine during the Fall '08 term at MIT.
 Fall '08
 ErikDemaine
 Algorithms

Click to edit the document details