Question
Which statement about Adjacency List vs Adjacency Matrix is the strongest interview answer?
- Adjacency List vs Adjacency Matrix is mostly a naming style choice and has little effect on runtime or design.
- Adjacency List vs Adjacency Matrix exists mainly to reduce the number of Java files in a project.
- Adjacency List vs Adjacency Matrix matters only for frontend frameworks, not for core Java applications.
- Graphs are usually represented with an adjacency list or an adjacency matrix depending on density and access needs.
Hint
Start with the core rule behind Adjacency List vs Adjacency Matrix.
Answer and rationale
Correct answer: D. Graphs are usually represented with an adjacency list or an adjacency matrix depending on density and access needs.
Graphs are usually represented with an adjacency list or an adjacency matrix depending on density and access needs. This is the base concept interviewers commonly test first.
Track: Java