Exam-style question
Try this first
Which statement is generally true when comparing adjacency lists with adjacency matrices?.
- A.An adjacency list records each vertex and the vertices connected to it
- B.An adjacency list must contain a row and column for every pair of vertices
- C.An adjacency matrix cannot represent an undirected graph
- D.An adjacency matrix can represent only weighted graphs
Model answer
What a good answer should say
- An adjacency list records each vertex and the vertices connected to it
Explanation
Why this works
An adjacency list stores each vertex together with its connected vertices. An adjacency matrix instead uses a table of vertex pairs.
Both can represent directed, undirected, weighted, or unweighted graphs when suitable entries are used.
Common mistake
No common mistake is linked to this question yet.
