Final Exam Flashcards
Suppose the compressed adjacency list representation is used for a directed graph with n vertices and m edges.
a) What is the value stored at the last entry of the tailTab?
b) What is the number of entries in the two tables?
a) m
b) n + 1 and m
What is the expected number of probes for an unsuccessful search in hashing by chaining when there are 2000 items stored in a structure with 100 linked lists?
20
What is the expected number of probes for a successful search in hashing by chaining with α as the load factor?
α / 2
The capacity of the following cut is ____. (S vertices are bold.)
S ->(5) A ->(4) B ->(3) C ->(2) D ->(1) T
16
Suppose a depth-first search on a directed graph yields a path of tree edges from vertex X to vertex Y and a path of tree edges from vertex X to Z. If there is also an edge from Y to X, then what type will it be?
a) back
b) cross
c) forward
d) tree
Back
Suppose a depth-first search on a directed graph yields a path of tree edges from vertex X to vertex Y and a path of tree edges from vertex X to Z. If there is also an edge from Y to Z, then what type will it be?
a) back
b) cross
c) forward
d) tree
Cross
Which of the following cannot occur when additional edges are included in a directed graph?
The number of strong components may increase.
For a double hash table with α = 0.9 (without deletions), the upper bound on the expected number of probes for unsuccessful search is:
10
What is required when calling union(i, j) for maintaining disjoint subsets?
i and j are leaders for different subsets
Suppose a directed graph has a path from vertex X to vertex Y, but no path from vertex Y to vertex X. The relationship between the finish times for depth-first search is:
finish(X) > finish(Y)
The cycle property for minimum spanning trees may be used to find an MST by:
Remove the maximum weight edge in any cycle until only a tree of edges remain.
What is the number of strongly connected components in this graph?
Understand strongly connected components
(includes a picture)
Which algorithm maintains multiple subtrees?
Kruskal’s
Which edge is chosen in a phase of Kruskal’s algorithm?
A minimum-weight edge that keeps the result free of cycles
Before searching for a minimum cut in a network, it is useful to do the following:
Find and record augmenting paths until none remains.