dagger icon indicating copy to clipboard operation
dagger copied to clipboard

Regarding the depth traversal issue of v1.0.1 version

Open JY-Sun-K opened this issue 2 years ago • 0 comments

dag: A->B->C

func (g *Graph) DFS(edgeType string, rootNode Path, fn func(nodePath Node) bool) {
	...
	stack := driver.NewInMemStack()
	...
	stack.Range(func(element interface{}) bool {
	....
}

stack.Range uses the pop function

output:

C,B,A

But the output of breadth traversal starts from A. So shouldn’t depth traversal also start from A?

Thanks!

JY-Sun-K avatar Jan 23 '24 01:01 JY-Sun-K