-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Description
Traversal is error of binary-tree.go.
// LNR
func inorder(n *node) {
if n == nil {
return
}
inorder(n.left)
fmt.Print(n.val, " ")
inorder(n.right)
}
// NLR
func preorder(n *node) {
if n == nil {
return
}
fmt.Print(n.val, " ")
preorder(n.left)
preorder(n.right)
}
// LRN
func postorder(n *node) {
if n == nil {
return
}
postorder(n.left)
postorder(n.right)
fmt.Print(n.val, " ")
}Metadata
Metadata
Assignees
Labels
No labels