DFS & BFS
DFS & BFS are two basic algorithms to traverse a graph(or a tree). DFS is Deep-first search and BFS is Breath-first search.
Basic idea
The idea behind two algorithms are identical but use different auxiliary data structure. DFS use stack and BFS use Queue.
First, Every node have a mark to identify is already be visited or not(it could be a list or an attribute in node).
Second, Push the start point into the auxiliary data structure and loop until structure is empty.
