Domanda di colloquio di LiveRamp

How do you count the distance between two nodes in a graph when using BFS?