Final Exam Flashcards

1
Q

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

a) m
b) n + 1 and m

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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?

A

20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the expected number of probes for a successful search in hashing by chaining with α as the load factor?

A

α / 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The capacity of the following cut is ____. (S vertices are bold.)
S ->(5) A ->(4) B ->(3) C ->(2) D ->(1) T

A

16

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

Back

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

A

Cross

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following cannot occur when additional edges are included in a directed graph?

A

The number of strong components may increase.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

For a double hash table with α = 0.9 (without deletions), the upper bound on the expected number of probes for unsuccessful search is:

A

10

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is required when calling union(i, j) for maintaining disjoint subsets?

A

i and j are leaders for different subsets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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:

A

finish(X) > finish(Y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The cycle property for minimum spanning trees may be used to find an MST by:

A

Remove the maximum weight edge in any cycle until only a tree of edges remain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the number of strongly connected components in this graph?

A

Understand strongly connected components
(includes a picture)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which algorithm maintains multiple subtrees?

A

Kruskal’s

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which edge is chosen in a phase of Kruskal’s algorithm?

A

A minimum-weight edge that keeps the result free of cycles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Before searching for a minimum cut in a network, it is useful to do the following:

A

Find and record augmenting paths until none remains.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which person listed below has not won the Turning Award?
a) Dijkstra
b) Goldberg
c) Karp
d) Tarjan

A

Goldberg

17
Q

The worst-case time for Prim’s algorithm implemented with a minheap is:

A

Θ (E log V)

18
Q

The number of edges in a maximum bipartite matching for the graph below is:

A

Understand maximum bipartite
(includes picture)

19
Q

What is the Edmonds-Karp variant?

A

Using BFS to search a residual network for an augmenting path.

20
Q

When using two breadth-first searches to find the diameter of a tree, the purpose of the first search is to find:

A

One end of a diameter

21
Q

Suppose that there is only one path from vertex 5 to vertex 10 in a directed graph:
5 -> 7 -> 4 -> 3 -> 2 -> 10
During the scan of which column will Warshall’s algorithm record the presence of this path?

A

7

22
Q

A topological ordering of a directed graph may be computed by:

A

Ordering the vertices by descending finish times after DFS

23
Q

The number of potential probe sequences when using double hashing with a table with m entries (m is prime) is:

A

m (m - 1)

24
Q

When finding the strongly connected components, the number of components is indicated by:

A

The number of restarts for the second depth-first search

25
Q

In Dijkstra’s algorithm, the final shortest path distance from the source s to a vertex x is known when:

A

x has its entry extracted from the heap

26
Q

Completed Tests:
Fall17 T3
Fall18 T3

A