CS 470/570 Quiz 4
Spring 2013
Preview / Study guide
This quiz will contain some (but maybe not all) of these kinds of problems.
Many examples can be found in the textbook exercises.
1. Trace algorithms for string matching (nave algorithm, Rabin-Karp, fini
CS 470/570 Quiz 4
Spring 2013
Name _
Answer any 3 of these 4 problems. If you have time, you may answer all 4 for extra credit.
1. Let pattern P[17] = 1201120 and text T[116] = 1120112011201120. Trace any 2 of
these 3 string matching algorithms.
a. Rabin-
CS 470/570 Quiz 3
Spring 2013
Preview / Study guide
This quiz will contain some (but not all) of these kinds of problems.
Many examples can be found in the textbook exercises.
1. Trace algorithms for all-pairs shortest-paths (matrix multiplication, Floyd,
CS 470/570 Quiz 3
Spring 2013
Solution
1. Consider the RSA cryptosystem with primes p=2 and q=11. First compute values n and w. Next use encryption key e=7 to encrypt message m=9 using modular exponentiation. Then use Euclid's extended gcd algorithm to co
CS 470/570 Quiz 3
Spring 2013
Name _
1. Consider the RSA cryptosystem with primes p=2 and q=11. First compute values n and w. Next use encryption key e=7 to encrypt message m=9 using modular exponentiation. Then use Euclid's extended gcd algorithm to comp
CS 470/570 Quiz 2
Spring 2013
Solution
1. An independent set in a graph is a set of vertices such that no two are adjacent. Professor
Greedy proposes the following greedy algorithm to find a maximum size independent set:
while (vertices remain in the grap
CS 470/570 Quiz 2
Spring 2013
Name _
1. An independent set in a graph is a set of vertices such that no two are adjacent. Professor
Greedy proposes the following greedy algorithm to find a maximum size independent set:
while (vertices remain in the graph)
CS 470/570 Quiz 1
Spring 2013
Solution
1. Write the solution T(n) for each recurrence equation as a simplest function of n.
Parts (a) through (e) use formulas we derived in class. [6 points]
a. T(n) = 8 T(n/2) + n4
(ni) = (n4)
b. T(n) = 16 T(n/2) + n4
(ni
CS 470/570 Quiz 1
Spring 2013
Name _
1. Write the solution T(n) for each recurrence equation as a simplest function of n. Parts (a) through (e) use formulas we derived in class. a. T(n) = 8 T(n/2) + n4 b. T(n) = 16 T(n/2) + n4 c. T(n) = 64 T(n/2) + n4 d.
CS 470/570 Final Exam
Spring 2013
Preview / Study guide
The final exam will consist of three parts, as follows:
Part 1 emphasizes NP-completeness and approximation algorithms.
This part will contain some (but maybe not all) of these kinds of problems:
1.
CS 470/570 Quiz 4
Spring 2013
Solution
Answer any 3 of these 4 problems. If you have time, you may answer all 4 for extra credit. 1. Let pattern P[1.7] = "1201120" and text T[1.16] = "1120112011201120". Trace any 2 of these 3 string matching algorithms. [