C# Graph Traversal

后端 未结 4 1174
刺人心
刺人心 2021-02-02 00:45

This algorithm does a great job of traversing the nodes in a graph.

Dictionary visited = new Dictionary();

Queue         


        
4条回答
  •  青春惊慌失措
    2021-02-02 01:22

    Since you're not tracking the path to the "current" node at all times you will have to construct that when you have found the target. If your Node class have a Parent property you could easily backtrack up the tree to construct the full path.

提交回复
热议问题