#datastructure#graph

Adjacency list is a collection of unordered lists, used to represent a finite graph. Each list define the set of vertices that connected to a vertex in a graph.

It takes less memory than using adjacency matrix.

But if we want to find out if there's an edge between two vertices $u$ and $v$, we would need to traversal the lists twice $O(2n)$. While using adjacency matrix only takes 1 lookup $O(1)$.