Pick the representation
Standard · Multiple choice · about 3 min
A program stores a graph of 200 vertices where almost every pair is joined. It asks millions of times whether two given vertices are joined. Which representation fits best?
Learn the idea first: Adjacency matrix, adjacency list, edge list, a visual lesson.
More Adjacency matrix, adjacency list, edge list problems
- Build an adjacency list Warm-up
- Memory cost Warm-up
- Matrix to list Standard
- Edge list to matrix Standard
- Look up an edge Standard
- Degree from each representation Challenge