Guided lesson

Graph Representation

Graphs

Graph Representation

Core

Mental model

  • Adjacency lists are efficient for sparse graphs.

Operations

list neighbors

Cost shape

Depends on representation

Watch out

Using a matrix for a huge sparse graph.

Related algorithms

BFSDFSKruskal MST
Guided progression
10% lesson
Step 1 / 2Learner goal
Speech settings Speed 1.0 · Volume 90%

Keyboard: Space play/pause · Arrow keys step · Page Up/Down change sections · R restart