Sign in
go
/
talks
/
42334b6f2551955b5e77dbcc47b0d511c24fa08e
/
.
/
2014
/
go4gophers
/
tree-walk.go
blob: 5a06f3ec708a068efe2e0dbe76051e4298cadcce [
file
] [
log
] [
blame
]
// +build OMIT
package main
import (
"fmt"
"code.google.com/p/go-tour/tree"
)
func Walk(t *tree.Tree) {
if t.Left != nil {
Walk(t.Left)
}
fmt.Println(t.Value)
if t.Right != nil {
Walk(t.Right)
}
}
func main() {
Walk(tree.New(1))
}