Adjacency List
Each vertex stores the vertices it connects to. Sparse graphs stay small. Checking one arbitrary pair means scanning that vertex’s list.
Costs
| Category | Data Structure |
| Difficulty | Medium |
| Memory | O(V + E) |
| List the neighbors of v | O(degree of v) |
| Check one edge, unsorted list | O(degree of v) |
Questions
What is Adjacency List?
Each vertex stores the vertices it connects to. Sparse graphs stay small. Checking one arbitrary pair means scanning that vertex’s list.
Where do I practice it?
DSA Master keeps challenges and progress on the phone. This page is the idea and the costs.