Skip to content

Instantly share code, notes, and snippets.

@esys
Created August 19, 2020 20:10
Show Gist options
  • Save esys/1893f8a1f5744fb3daee174b48056382 to your computer and use it in GitHub Desktop.
Save esys/1893f8a1f5744fb3daee174b48056382 to your computer and use it in GitHub Desktop.
var wg sync.WaitGroup
func DFRecImproved(n *Node){
if n == nil {
return
}
wg.Add(1)
go DFRecImproved(n.Left)
n.Process()
wg.Add(1)
go DFRecImproved(n.Right)
wg.Done()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment