Adjacency List
An adjacency list stores, for each vertex, a collection of its neighboring vertices. For weighted graphs, each entry can contain the neighbor and edge weight. It uses O(V+E) space and is usually the preferred representation for sparse graphs and traversal algorithms.
Space: O(V+E).
Neighbor traversal: O(degree(v)).
Excellent for sparse graphs.
BFS and DFS naturally operate on adjacency lists.
Checking whether a specific edge exists may take O(degree(v)).
0-2 years experience
2-5 years experience
5-8 years experience
8+ years experience