Computer Science I / Graph Representations
Practice question · Multiple choice

An adjacency list couples memory usage directly to the number of existing connections, whereas a matrix allocates for all potential connections. What follows from this distinction when choosing an architecture for dynamic networks?

Hints
  1. Does adding new connections change the memory footprint of a fixed grid?
  2. What determines the size of each vertex's neighbour collection?
Show the answer

C. List memory scales with edge growth instead of worst-case capacity

Why

Matrix sizes depend strictly on vertex count regardless of sparsity, while lists allocate only for real edges. At extreme density, list node overhead can surpass simple tabular arrays, but edge lookup costs remain bounded by vertex degree rather than whole-graph scale.

Read the lesson: Graph Representations →

Practise Graph Representations

The app has 7 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Graph Representations