Glossary: Data Structures and Algorithms in Go
O(V + E)
The cost of BFS and DFS, where V is the number of vertices and E the number of edges: each place and each road is handled a fixed number of times.
Where the book teaches it
Related terms
Breadth-first search (BFS)Depth-first search (DFS)VertexEdge