Skip to content

Glossary: Data Structures and Algorithms in Go

cameFrom map

Also written: cameFrom, came_from

A map used in BFS that records, for each place, the place you came from when you first reached it. Walking it backward from the goal rebuilds the route.

Where the book teaches it

Related terms

Breadth-first search (BFS)slices.Reverse