| NAME: Final Exam |
May 17, 1999 Computer Science 226 |
This test is 16 questions for a total of 100 points, weighted as indicated. Do all of your work on these pages (use the back for scratch space), giving the answer in the space provided. Put your name on every page (now), and write out and sign the Honor Code pledge before turning in the test. You have three hours to complete the test.
``I pledge my honor that I have not violated the Honor Code during
this examination.''
1. ___/10
2. ___/5
3. ___/5
4. ___/5
5. ___/5
6. ___/10
7. ___/5
8. ___/5
9. ___/5
10. ___/5
11. ___/5
12. ___/10
13. ___/5
14. ___/5
15. ___/5
16. ___/10
TOTAL: ___/100
___ Kruskal A. finds strong components in linear time ___ Floyd B. general graph-searching scheme ___ Kosaraju C. optimal MST algorithm for dense graphs ___ Prim D. fundamental recursive method ___ Warshall E. for single-source shortest paths in unweighted graphs ___ DFS F. for reachability in dense digraphs ___ BFS G. reduces MST computation to sorting ___ PFS H. for all-pairs shortest paths in dense graphs2. (5 points) The following table gives the KMP state transitions for the string 10100110, except for one state transition, labelled X in the table. What should the value of X be?
0 1 2 3 4 5 6 7
------------------------
0 | 0 2 0 4 5 0 2 8
1 | 1 1 3 1 X 6 7 1
A. The deterministic FSA might have an exponential number of states.
B. There might exist a string that the deterministic FSA
recognizes but the nondeterministic FSA does not.
C. There might exist a string that the nondeterministic FSA
recognizes but the deterministic FSA does not.
D. The nondeterministic FSA might loop.
E. The proof of the theorem is not constructive (does not
tell us how to construct the deterministic FSA).
a ____
c ____
g ____
t ____
A. log N
B. (log N)*(log N)
C. square root of N
D. N * log N
E. N
LZ _____
LZW _____
(10, 15) (2, 3) (5, 6) (8, 9)
0-7 0-1 1-4 1-6 2-3 3-4 4-2 5-2 6-0 6-3 6-5 7-1 7-3 .List the strongly connected components of this digraph.
___ T(N) = 2 T (N/2) + 1 A. N log N ___ T(N) = T (N/2) + 1 B. linear ___ T(N) = 3 T (N/2) + N C. log N ___ T(N) = 4 T (N/2) + 1 D. quadratic ___ T(N) = 2 T (N/2) + N E. none of the above
DFS __________ BFS __________
___ Find the largest complete subgraph. ___ Find a set of edges that separates the graph. ___ Find a path that uses each vertex exactly once, or report that none exists. ___ Find a path that uses each edge exactly twice, or report that none exists. ___ Find the smallest set of edges that connects all the vertices. ___ Find the vertices in a digraph that are not on a directed cycle.
0-1 (.4) 0-2 (.5) 0-3 (.9) 1-2 (.3) 2-3 (.2)
2-4 (.4) 3-5 (.8) 3-6 (.6) 4-6 (.5) 5-6 (.4)
Give the parent-link representation of the MST
computed by Prim's algorithm, using the standard adjacency-matrix
representation.
___ empirical study A. know to stop seeking a better algorithm ___ linear programming B. cope with NP-completeness ___ NP-completeness proof C. guarantee performance ___ average-case analysis D. predict performance ___ optimality proof E. find a polynomial-time solution ___ worst-case analysis ___ approximation algorithm