How Many Steps Apart? Breadth-First Search

Find how many friendships apart two people are, the fewest, without listing every route or walking in circles: why both of those fail, and the search that fixes them, breadth-first search, with a queue and a visited set.

Updated

Cheat sheet: How Many Steps Apart? Breadth-First Search
Category
Data Structures
Level
Journeyman
Tags
Breadth-First Search, data structures, Graph, Shortest Path, Vertex