Introduction to Algorithms
October
17,
2005
Massachusetts
Institute
of
Technology
6.046J/18.410J
Professors
Erik
D.
Demaine
and
Charles
E.
Leiserson
Handout
15
Problem Set 4
MIT students:
This
problem
set
is
due
in
lecture
on
Monday, October 24, 2005.
The
homework
lab
for
this
problem
set
will
be
held
2–4
P
.
M
.
on
Sunday,
October
23,
2005
.
Reading:
Chapters
12–13,
18
Both
exercises
and
problems
should
be
solved,
but
only the problems
should
be
turned
in.
Exercises
are
intended
to
help
you
master
the
course
material.
Even
though
you
should
not
turn
in
the
exercise
solutions,
you
are
responsible
for
material
covered
in
the
exercises.
Mark
the
top
of
each
sheet
with
your
name,
the
course
number,
the
problem
number,
your
recitation
section,
the
date
and
the
names
of
any
students
with
whom
you
collaborated.
Please
staple and turn in your solutions on 3hole punched paper
.
You
will
often
be
called
upon
to
“give
an
algorithm”
to
solve
a
certain
problem.
Your
writeup
should
take
the
form
of
a
short
essay.
A
topic
paragraph
should
summarize
the
problem
you
are
solving
and
what
your
results
are.
The
body
of
the
essay
should
provide
the
following:
1.
A
description
of
the
algorithm
in
English
and,
if
helpful,
pseudocode.
2.
At
least
one
worked
example
or
diagram
to
show
more
precisely
how
your
algorithm
works.
3.
A
proof
(or
indication)
of
the
correctness
of
the
algorithm.
4.
An
analysis
of
the
running
time
of
the
algorithm.
Remember,
your
goal
is
to
communicate.
Full
credit
will
be
given
only
to
correct
solutions
which are described clearly
.
Convoluted
and
obtuse
descriptions
will
receive
low
marks.
Exercise 41.
Do
Exercise
12.15
on
page
256
of
CLRS.
Exercise 42.
Do
Exercise
12.24
on
page
260
of
CLRS.
Exercise 43.
Do
Exercise
12.43
on
page
268
of
CLRS.
Exercise 44.
Do
Exercise
13.16
on
page
277
of
CLRS.
Exercise 45.
Do
Exercise
13.31
on
page
287
of
CLRS.
Exercise 46.
Do
Exercise
18.26
on
page
449
of
CLRS.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document2
Handout
15:
Problem
Set
4
Problem 41.
Treaps
If
we
insert
a
set
of
n
items
into
a
binary
search
tree
using
T
REE
I
NSERT
,
the
resulting
tree
may
be
horribly
unbalanced.
As
we
saw
in
class,
however,
we
expect
randomly
built
binary
search
trees
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '05
 ErikD.DemaineandCharlesE.Leiserson
 LG, CLRS, NSERT, REAP I NSERT

Click to edit the document details