// NewControllableDfs execute the DFS search on a graph, start from the root node
// can be exit by control condition
// only stack based implemetation
NewControllableDfs execute the DFS search on a graph, start from the root node
can be exit by control condition
only stack based implemetation
// NewControllableDfs execute the DFS search on a graph start from the root node // can be exit by control condition // only stack based implemetation
func NewControllableDfs(g graph.Graph, root graph.NodeID, control SearchControl) (*Dfs, error) {
	dfsContext := &Dfs{0, []dfsTree{}, nodeAttrArray{}, edgeAttrArray{}}
	dfsContext.initialize(g)
	dfsContext.forest = append(dfsContext.forest, dfsTree{root}) 
	dfsContext.dfsStackBasedVisit(g, root, control)
	return dfsContext, nil
}
func NewControllableDfs ( g graph . Graph , root graph . NodeID , control SearchControl ) ( * Dfs , error ) { dfsContext := & Dfs { 0 , [ ] dfsTree { } , nodeAttrArray { } , edgeAttrArray { } } dfsContext . initialize ( g ) dfsContext . forest = append ( dfsContext . forest , dfsTree { root } ) dfsContext . dfsStackBasedVisit ( g , root , control ) return dfsContext , nil }
NewControllableDfs execute the DFS search on a graph, start from the root node
can be exit by control condition
only stack based implemetation
NewControllableDfs execute the DFS search on a graph start from the root node can be exit by control condition only stack based implemetation
// Initialize //record a tree's root // execute one tree search