Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Path, cycle, connected, degree. Two vertices are connected if there is a path between them.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Adjacency matrix: V × V booleans, O(V²) space; check an edge in O(1).
Exam weight High
- Adjacency lists: a list of neighbours per vertex; space O(E + V). Used in practice (sparse graphs).
🎯 How this can come up · 1 question
MCQ
For a large sparse graph, the usual representation is:
Correct: Adjacency lists.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- DFS: go as deep as possible, backtrack; marks every vertex connected to s in time proportional to the sum of degrees.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight High
- BFS: visit vertices in order of distance from s using a QUEUE; finds shortest paths (fewest edges).
🎯 How this can come up · 2 questions
MCQ
Which search finds the path with the fewest edges in an unweighted graph?
Correct: Breadth-first search.
MCQ
BFS uses which data structure?
Correct: A queue.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Connected components: run DFS from each unmarked vertex; label vertices with a component id.
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
No slides match this filter.



























































