Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryTreeNode ¶
type BinaryTreeNode struct { Value interface{} Left *BinaryTreeNode Right *BinaryTreeNode }
Binary tree node Left: left child Right: right child
func (*BinaryTreeNode) TraverseInorder ¶
func (n *BinaryTreeNode) TraverseInorder(v BinaryTreeVisitor, depth int)
Traverse from this node by in-order
func (*BinaryTreeNode) TraversePostorder ¶
func (n *BinaryTreeNode) TraversePostorder(v BinaryTreeVisitor, depth int)
Traverse from this node by post-order
func (*BinaryTreeNode) TraversePreorder ¶
func (n *BinaryTreeNode) TraversePreorder(v BinaryTreeVisitor, depth int)
Traverse from this node by pre-order
type BinaryTreeVisitor ¶
type BinaryTreeVisitor interface {
Visit(node *BinaryTreeNode, depth int)
}
Visitor interface for binary tree
Click to show internal directories.
Click to hide internal directories.