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
Answer and explanation
Concise answer
An adjacency list records each vertex and the vertices connected to it
Why this is correct
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.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
