Data Structures: Breadth-First Search

Your function will output a JavaScript object key-value pairs with the node and its distance from the root. If the node could not be reached, it should have a distance of Infinity .

What does this mean? I don’t understand the question.

Hi, I’m working on this now, and I believe that what they want is a javascript object where the key corresponds to the nodes (denoted by rows in the graph) and the paired values correspond to the distance of that node from the root node. I hope that my phrasing is a bit clearer than that of the question