Introduction
to
Algorithms
November
7,
2005
Massachusetts
Institute
of
Technology
6.046J/18.410J
Professors
Erik
D.
Demaine
and
Charles
E.
Leiserson
Handout
22
Problem
Set
7
MIT
students:
This
problem
set
is
due
in
lecture
on
Monday,
November
14,
2005.
There
will
be
two
homework
labs
for
this
problem
set,
one
held
6–8
P
.
M
on
Wednesday,
November
9,
2005
and
one
held
2–4
P
.
M
.
on
Sunday,
November
13,
2005
.
Reading:
Chapter
15,
16.1–16.3,
22.1,
and
23.
Problem
71
is
mandatory.
Failure
to
turn
in
a
solution
will
result
in
a
serious
and
neg
ative
impact
on
your
term
grade!
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
71.
Do
Exercise
15.43
on
page
356
of
CLRS.
Exercise
72.
Do
Exercise
16.13
on
page
379
of
CLRS.
Exercise
73.
Do
Exercise
16.32
on
page
384
of
CLRS.
Exercise
74.
Do
Exercise
22.15
on
page
530
of
CLRS.
Exercise
75.
Do
Exercise
23.15
on
page
566
of
CLRS.
Exercise
76.
Do
Exercise
23.24
on
page
574
of
CLRS.
Exercise
77.
Do
Exercise
23.25
on
page
574
of
CLRS.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
2
Handout
22:
Problem
Set
7
Problem
71.
Edit
distance
In
this
problem
you
will
write
a
program
to
compute
edit
distance.
This
problem
is
mandatory.
Failure
to
turn
in
a
solution
will
result
in
a
serious
and
negative
impact
on
your
term
grade!
We
advise
you
to
start
this
programming
assignment
as
soon
as
possible,
because
getting
all
the
details
right
in
a
program
can
take
longer
than
you
think.
Many
word
processors
and
keyword
search
engines
have
a
spelling
correction
feature.
If
you
type
in
a
misspelled
word
x
,
the
word
processor
or
search
engine
can
suggest
a
correction
y
.
The
correction
y
should
be
a
word
that
is
close
to
x
.
One
way
to
measure
the
similarity
in
spelling
between
two
text
strings
is
by
“edit
distance.”
The
notion
of
edit
distance
is
useful
in
other
fields
as
well.
For
example,
biologists
use
edit
distance
to
characterize
the
similarity
of
DNA
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '05
 ErikD.DemaineandCharlesE.Leiserson
 CLRS, edit distance

Click to edit the document details