Sign in
go
/
website
/
1e75b26cba0e55a9f61c79dbb46459a4e6ddbd65
/
.
/
_content
/
talks
/
2014
/
go4gophers
/
tree-walk.go
blob: c43c0e76fc257702cd018498d4dc59738cc2666a [
file
] [
log
] [
blame
]
// +build ignore,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))
}