binarytree

package
v0.0.0-...-34ffc9b Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 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 ArrayTree

type ArrayTree struct {
	Array []*TreeNode
}

ArrayTree is Array representation of tree 1, 2, 3, 4, 5 =>

      1
  2      3
4  5  nil nil

func NewArrayTree

func NewArrayTree(input []interface{}) *ArrayTree

NewArrayTree is constructor of creating a ArrayTree with giving slice

func (*ArrayTree) GetRoot

func (a *ArrayTree) GetRoot() *TreeNode

GetRoot return the root TreeNode of tree

type TreeNode

type TreeNode struct {
	Left  *TreeNode
	Right *TreeNode
	Val   interface{}
}

TreeNode is simple not ancesstor treenode

Jump to

Keyboard shortcuts

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