9.3 (Graph Traversal) Flashcards

1
Q

What is a sequence of vertices linked by edges?

A

path

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

What is the maximal set of vertices that are connected?

A

connected component

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

An algorithm that checks __________ can be instrumented to report a path between the two vertices.

A

reachability

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

A path is a ________ that two vertices are connected

A

witness

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

What is it called when finding a witness?

A

search problem

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

What is it called when checking a witness?

A

verification problem

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

For Depth-First Search, what is the total time complexity for adjacency list representation?

A

O(V+E)

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

For Depth-First Search, what is the total time complexity for adjacency matrix representation?

A

O(V^2)

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

Which representation is more efficient for sparse graphs?

A

Adjacency List

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

Adjacency Matrix is inefficient unless the graph is dense (___ = ____)

A

(E=V^2)

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

What are the two implementations of Depth-First Search?

A

Recursive DFS and Stack-based DFS

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

Which type of Depth-First Search (DFS) uses the call stack to track visited nodes?

A

Recursive DFS

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

Which type of Depth-First Search (DFS) uses an explicit stack instead of recursion?

A

Stack-based DFS

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

What kind of array tracks the vertices either already examined or queued up to be examined?

A

mark array

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

All vertices above the frontier are _________.

A

explored

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

All vertices below the frontier are ________.

A

unexplored

17
Q

True or false: every path from a start to a target goes through the frontier.

18
Q

For Breadth-First Search, what is the total time complexity for adjacency list representation?

19
Q

For Breadth-First Search, what is the total time complexity for adjacency matrix representation?

20
Q

What are the two implementations of Breadth-First Search?

A

Queue-based BFS and Recursive DFS

21
Q

Which BFS implementation uses a queue (FIFO) to track visited nodes?

A

Queue-based BFS

22
Q

Which BFS implementation uses recursion instead of an explicit queue?

A

Recursive DFS