






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







CECS 328 Final, Fall 2002, Professor Ebert
Name:
For multiple choice problems, circle the best answer unless otherwise indicated. For long problems, show all work to receive full credit. Multiple choice problems are worth 5 points each unless otherwise stated.
sum=0; for(i=0; i < n; i++){ j=i; while(j !=0){ if( j % 2 == 0) sum++; j /= 2; } }
18a. For the undirected graph below, use Dijkstra’s algorithm to find the distance of each vertex from vertex a. (20 points)
19a. For the bipartite graph G shown below, draw the network graph N G that is associated with it. (5 points)
19b. Now let M = {(1, 1), (2, 2), (3, 3)} be a matching for G. Use this to draw the augmented network A(N G, M ), with respect to N G and M. Indicate a path from s to t in this network. (10 points)
21a. Use Kruskals algorithm to find a minimum spanning tree for the following graph. Show the forest for each stage of the algorithm. (15 points)
21b. Would Prim’s and Kruskal’s algorithms work just as well for finding maximum spanning trees (assuming of course at each stage we choose edges of maximum cost as opposed to minimum cost)? Prove or disprove. (10 points)
21c. For the graph of part a, assuming the adjacency lists are in alphabetical order, give the minimum spanning tree induced by a depth-first traversal starting at vertex a. (10 points)
Figure 1