Adjacency List
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)).
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.