binary_tree

package
v0.0.0-...-3ef4865 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 0 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL