This preview shows pages 1–2. Sign up to view the full content.
Algorithms  Exercise 3
TA in charge: Dvir
You should provide correctness proofs and runningtime analysis for all your
algorithms.
1. Recall the
Longest Common Subsequence problem
shown in class. Assume that the algorithm
for solving the problem would have used recursion without saving the solutions of subproblem
calculations in a table. Show that the running time of the modiFed algorithm is, in the worst
case, exponential in the lengths of the given strings.
2. You are given a list
L
of strings written using the characters AZ. Give an algorithm that
receives a string
s
and outputs
true
i± the string is a concatenation of strings from
L
.
3. You are given a series of words (
w
1
, w
2
, ..., w
n
) in varying lengths. We are interested in
printing all the words,
by the order they are given in
, without spaces between them, in
a document in which each line may contain at most
L
characters. You can not divide a word
between lines.
We are interested in minimizing the sum of the cubes (third power) of the unused characters
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.
 Spring '10
 Prizler
 Algorithms

Click to edit the document details