Created
August 19, 2020 20:11
-
-
Save esys/1c80adc97c2b49bb7c85fe258e53ef41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
n := NewNode(1) | |
n.Left = NewNode(2) | |
n.Right = NewNode(3) | |
n.Left.Left = NewNode(4) | |
n.Left.Right = NewNode(5) | |
n.Right.Left = NewNode(6) | |
n.Right.Right = NewNode(7) | |
n.Right.Right.Left = NewNode(8) | |
start := time.Now() | |
DFRec(n) | |
fmt.Printf("took %v\n", time.Now().Sub(start)) | |
start = time.Now() | |
wg.Add(1) | |
go DFRecImproved(n) | |
wg.Wait() | |
fmt.Printf("took %v\n", time.Now().Sub(start)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment