Memory cost
Warm-up · Multiple choice · about 3 min
A road map has 10,000 crossings (vertices) and 25,000 roads (undirected edges). About how many values does an adjacency matrix store, and how many does an adjacency list store?
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
- Matrix to list Standard
- Edge list to matrix Standard
- Look up an edge Standard
- Pick the representation Standard
- Degree from each representation Challenge