How to implement Depth-first search through a tree of objects?
问题 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