In a directed graph, what is a definition of a node neighbor ?
To be more specific, in the graph below, which nodes are considered to be neighbors of node 0?
Cracking the coding interview seems to suggest that both 1 and 2 are neighbors of 0, but it doesn't state it clearly and I can't find a proper definition online.
EDIT:
My confusions arises from this specific passage:
In the adjacency matrix representation, you will need to iterate through all the nodes to identify a node's neighbors.
This seems to imply that 2 is considered 0's neighbor, otherwise you just need to go through 0's row to find its neighbors. But it never says this clearly.
