Sign in
go
/
talks
/
2dabb55a877115e60c5a9f8ea62d7eb9cd50c35d
/
.
/
2014
/
go4gophers
/
tree-walk.go
blob: c4c7ea05f83cc59102e11f542ba9b6906bfa337a [
file
] [
log
] [
blame
]
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))
}