finsolgg

# Therefore t n is o n log n grading guidelines a 15

This preview shows pages 6–8. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
(g) Let G be a digraph with n nodes and s one of its nodes. The discovery edges found by DFS starting from s always form a tree with n - 1 edges, true or false? Answer: FALSE. They form a tree but the nodes in this tree are only those nodes reachable by a path from s and there may be strictly less than n such nodes, therefore the tree may have strictly less than n - 1 edges. (h) In a 4-way trie we store 3 distinct keys, each of them a 2-character string. The resulting trie can have as many as 22 null links, true or false? Answer: TRUE. The trie is largest of all 3 keys have a diﬀerent ﬁrst character. Then there 1 null link from the root, 9 null links from the 3 nodes at depth 1, and 12 null links from the 3 nodes at depth 2. 1 + 9 + 12 = 22. Grading guidelines: As usual: 2 points for correct true or false statement; 3 points for for correct explanation. 9. (20pts) Consider the following undirected weighted graph (ﬁve nodes labeled A,B,C,D,E,F and the edge weights are either 1 or 3 as shown). We use Dijkstra’s algorithm to compute the lengths of the shortest paths from A to the other nodes. ! # \$ % ' ( ( ( ( ( ( ) ) ) ) (a) Dijkstra’s algorithm begins by relaxing the edges
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page6 / 11

Therefore T n is O n log n Grading guidelines a 15 points...

This preview shows document pages 6 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online