How to implement Depth-first search through a tree of objects?

点点圈 提交于 2019-12-11 06:54:41

问题


Looking for some code examples with explanation. Wikipedia is too abstract on this.


回答1:


You could check the Wikipedia sources. Here's what I found for you:

http://www.algolist.net/Algorithms/Graph/Undirected/Depth-first_search

It gives example and some code sample. Pretty easy to follow.




回答2:


Get Complete Implementation of DFS in Java using Tree here http://c-madeeasy.blogspot.com/2011/08/dfsdepth-first-search-program-in-java.html



来源:https://stackoverflow.com/questions/5780754/how-to-implement-depth-first-search-through-a-tree-of-objects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!