Documentation ¶
Index ¶
- type BinTree
- func (b *BinTree) Depth() int
- func (b *BinTree) Init() *BinTree
- func (b *BinTree) InorderTraverse(visit func(e *Element))
- func (b *BinTree) InorderTraverseIteration(visit func(e *Element))
- func (b *BinTree) LevelorderTraverse(visit func(e *Element))
- func (b *BinTree) PostorderTraverse(visit func(e *Element))
- func (b *BinTree) PostorderTraverseIteration(visit func(e *Element))
- func (b *BinTree) PreorderTraverse(visit func(e *Element))
- func (b *BinTree) PreorderTraverseIteration(visit func(e *Element))
- type Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinTree ¶
type BinTree struct {
Element
}
BinTree represents a binary tree. The zero value for tree is an empty tree ready to use.
func (*BinTree) InorderTraverse ¶
func (*BinTree) InorderTraverseIteration ¶
func (*BinTree) LevelorderTraverse ¶
func (*BinTree) PostorderTraverse ¶
func (*BinTree) PostorderTraverseIteration ¶
func (*BinTree) PreorderTraverse ¶
PreorderTraverse visit element with recursive pre-order
func (*BinTree) PreorderTraverseIteration ¶
type Element ¶
type Element struct { // The value stored with this element. Value interface{} // contains filtered or unexported fields }
Element is an element of a binary tree.
func NewElement ¶
func NewElement(v interface{}) *Element
Click to show internal directories.
Click to hide internal directories.