NAME
1-4 CHARACTERS CODE(if you want your final grade posted)
CIS 680: Final Exam
1:50 minutes
Open Notes, Open Books
The exam consists of five problems
Answers not appearing in designated spaces WILL NOT be graded
- Problem #1 (10 points)
Add the keys 6.1, 6.2, 6.3, 6.4, and 6.5 to the following B-tree
of degree 3, and show all the intermediate trees and the final
tree.
- Problem #2 (10 points)
- Describe an algorithm to determine whether a directed graph has exactly one topological order.
- What is the time complexity of your algorithm?
- Problem #3 (10 points)
Show the linked lists of the union-find algorithm, at all the instances of applying Kruskal’s algorithm on the
following graph.
- Problem #4 (10 points)
The 3-vertex cover problem for graphs asks to assign a vertex cover of cardinality three to the given graphs. Assume
an undirected graph whose edges are (1,2), (1,4), (1,5), (2,3), (2,4), (3,4), (4,5).
- Provide a spanning tree of a solution space, for the 3-vertex cover problem on the given graph.
- What vertex cover the backtracking algorithm provides for the above tree?
- What vertex cover the FIFO branch-and-bound algorithm provides on the above tree?
- Problem #5 (10 points)
Consider the following recursive function.
function value(i) {
if (i >= n) return 0;
return 1 + max( value(2*i+1), value(2*i+2),
value(4*i+3) + value(4*i+4) + value(4*i+5),
value(4*i+5) + value(4*i+6) );
}
Translate the code into an iterative bottom-up dynamic programming algorithm.