binary_tree

package
v0.0.0-...-d4680e3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeight

func GetHeight(node *Node) int

Types

type BinaryTree

type BinaryTree struct {
	Nodes []Node
	Head  *Node
}

func GenerateBinaryTreeFromSortedArray

func GenerateBinaryTreeFromSortedArray(a []int) BinaryTree

func (*BinaryTree) Insert

func (bt *BinaryTree) Insert(value int)

func (*BinaryTree) Search

func (bt *BinaryTree) Search(value int) *Node

func (*BinaryTree) Traverse

func (bt *BinaryTree) Traverse()

type Node

type Node struct {
	Value  int
	Parent *Node
	Left   *Node
	Right  *Node
}

type QueueItem

type QueueItem struct {
	Node   *Node
	Middle int
	Start  int
	End    int
}

Jump to

Keyboard shortcuts

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