Graphs
9 min · Go examples
Represent nodes and edges with an adjacency list, then traverse to explore connections.
Go · Graphs0/5 cleared
Enemy 1 of 5
A graph is a set of nodes (vertices) and edges between them. An adjacency list maps each node to its neighbors, perfect for sparse graphs and interview problems.
Once you have adjacency, BFS and DFS from a start node count reachable nodes, detect cycles, or find paths.
You
Memory-Leak Rat
Loading editor...
Ln 1, Col 1Spaces: 4
Sign up to fightTarget output: 4