Documentation ¶
Index ¶
- func ConditionalFold(conditionalVisitFunc func(func(interface{}) bool) bool, ...) (bool, interface{})
- func ConditionalFoldNode(conditionalVisitNodeFunc func(func(*Node) bool) bool, ...) (bool, interface{})
- func Float64Less(a interface{}, b interface{}) bool
- func Fold(visitFunc func(func(interface{})), ...) interface{}
- func FoldNode(visitNodeFunc func(func(*Node)), f func(*Node, interface{}) interface{}, ...) interface{}
- func IntLess(a interface{}, b interface{}) bool
- func StringLess(a interface{}, b interface{}) bool
- type Node
- func (n *Node) BalanceFactor() int
- func (n *Node) ConditionalVisitInOrder(predicate func(interface{}) bool) bool
- func (n *Node) ConditionalVisitNodeInOrder(predicate func(*Node) bool) bool
- func (n *Node) ConditionalVisitNodePostOrder(predicate func(*Node) bool) bool
- func (n *Node) ConditionalVisitNodePreOrder(predicate func(*Node) bool) bool
- func (n *Node) ConditionalVisitPostOrder(predicate func(interface{}) bool) bool
- func (n *Node) ConditionalVisitPreOrder(predicate func(interface{}) bool) bool
- func (n *Node) Contains(v interface{}, lessFunc func(interface{}, interface{}) bool) bool
- func (n *Node) Float64Value() float64
- func (n *Node) IntValue() int
- func (n *Node) Print(buffer *bytes.Buffer, indentString string, indentLevel int)
- func (n *Node) Search(v int, consumer func(*Node) (int, interface{})) interface{}
- func (n *Node) String() string
- func (n *Node) StringValue() string
- func (n *Node) Value() interface{}
- func (n *Node) VisitInOrder(consumer func(interface{}))
- func (n *Node) VisitNodeInOrder(consumer func(*Node))
- func (n *Node) VisitNodePostOrder(consumer func(*Node))
- func (n *Node) VisitNodePreOrder(consumer func(*Node))
- func (n *Node) VisitPostOrder(consumer func(interface{}))
- func (n *Node) VisitPreOrder(consumer func(interface{}))
- type Tree
- func (t *Tree) Cap() int
- func (t *Tree) Clone() *Tree
- func (t *Tree) ConditionalVisitInOrder(predicate func(interface{}) bool) bool
- func (t *Tree) ConditionalVisitNodeInOrder(predicate func(*Node) bool) bool
- func (t *Tree) ConditionalVisitNodePostOrder(predicate func(*Node) bool) bool
- func (t *Tree) ConditionalVisitNodePreOrder(predicate func(*Node) bool) bool
- func (t *Tree) ConditionalVisitPostOrder(predicate func(interface{}) bool) bool
- func (t *Tree) ConditionalVisitPreOrder(predicate func(interface{}) bool) bool
- func (t *Tree) Contains(v interface{}) bool
- func (t *Tree) Delete(v interface{})
- func (t *Tree) Insert(v interface{})
- func (t *Tree) IsEmpty() bool
- func (t *Tree) IsFull() bool
- func (t *Tree) Len() int
- func (t *Tree) Print(indentString string) string
- func (t *Tree) String() string
- func (t *Tree) VisitInOrder(consumer func(interface{}))
- func (t *Tree) VisitNodeInOrder(consumer func(*Node))
- func (t *Tree) VisitNodePostOrder(consumer func(*Node))
- func (t *Tree) VisitNodePreOrder(consumer func(*Node))
- func (t *Tree) VisitPostOrder(consumer func(interface{}))
- func (t *Tree) VisitPreOrder(consumer func(interface{}))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConditionalFold ¶
func ConditionalFold( conditionalVisitFunc func(func(interface{}) bool) bool, f func(interface{}, interface{}) (bool, interface{}), acc0 interface{}, ) (bool, interface{})
ConditionalFold TODO: Write this comment!
func ConditionalFoldNode ¶
func ConditionalFoldNode( conditionalVisitNodeFunc func(func(*Node) bool) bool, f func(*Node, interface{}) (bool, interface{}), acc0 interface{}, ) (bool, interface{})
ConditionalFoldNode TODO: Write this comment!
func Float64Less ¶
func Float64Less(a interface{}, b interface{}) bool
func Fold ¶
func Fold( visitFunc func(func(interface{})), f func(interface{}, interface{}) interface{}, acc0 interface{}, ) interface{}
Fold TODO: Write this comment!
func FoldNode ¶
func FoldNode( visitNodeFunc func(func(*Node)), f func(*Node, interface{}) interface{}, acc0 interface{}, ) interface{}
FoldNode TODO: Write this comment!
func StringLess ¶
func StringLess(a interface{}, b interface{}) bool
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a node in Tree.
func (*Node) BalanceFactor ¶
BalanceFactor TODO: Write this comment!
func (*Node) ConditionalVisitInOrder ¶
ConditionalVisitInOrder traverses the subtree rooted at n in in-order (LNR). The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Node) ConditionalVisitNodeInOrder ¶
ConditionalVisitNodeInOrder traverses the subtree rooted at n in in-order (LNR). Any nil children of leaf nodes are also traversed. The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Node) ConditionalVisitNodePostOrder ¶
ConditionalVisitNodePostOrder traverses the subtree rooted at n in post-order (LRN). Any nil children of leaf nodes are also traversed. The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Node) ConditionalVisitNodePreOrder ¶
ConditionalVisitNodePreOrder traverses the subtree rooted at n in pre-order (NLR). Any nil children of leaf nodes are also traversed. The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Node) ConditionalVisitPostOrder ¶
ConditionalVisitPostOrder traverses the subtree rooted at n in post-order (LRN). The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Node) ConditionalVisitPreOrder ¶
ConditionalVisitPreOrder traverses the subtree rooted at n in pre-order (NLR). The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Node) Float64Value ¶
Float64Value TODO: Write this comment!
func (*Node) StringValue ¶
StringValue TODO: Write this comment!
func (*Node) VisitInOrder ¶
func (n *Node) VisitInOrder(consumer func(interface{}))
VisitInOrder traverses the subtree rooted at n in in-order (LNR).
func (*Node) VisitNodeInOrder ¶
VisitNodeInOrder traverses the subtree rooted at n in in-order (LNR). Any nil children of leaf nodes are also traversed.
func (*Node) VisitNodePostOrder ¶
VisitNodePostOrder traverses the subtree rooted at n in post-order (LRN). Any nil children of leaf nodes are also traversed.
func (*Node) VisitNodePreOrder ¶
VisitNodePreOrder traverses the subtree rooted at n in pre-order (NLR). Any nil children of leaf nodes are also traversed.
func (*Node) VisitPostOrder ¶
func (n *Node) VisitPostOrder(consumer func(interface{}))
VisitPostOrder traverses the subtree rooted at n in post-order (LRN).
func (*Node) VisitPreOrder ¶
func (n *Node) VisitPreOrder(consumer func(interface{}))
VisitPreOrder traverses the subtree rooted at n in pre-order (NLR).
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree implements an AVL tree.
func (*Tree) ConditionalVisitInOrder ¶
ConditionalVisitInOrder traverses t in in-order (LNR). The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Tree) ConditionalVisitNodeInOrder ¶
ConditionalVisitNodeInOrder traverses t in in-order (LNR). Any nil children of leaf nodes are also traversed. The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Tree) ConditionalVisitNodePostOrder ¶
ConditionalVisitNodePostOrder traverses t in post-order (LRN). Any nil children of leaf nodes are also traversed. The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Tree) ConditionalVisitNodePreOrder ¶
ConditionalVisitNodePreOrder traverses t in pre-order (NLR). Any nil children of leaf nodes are also traversed. The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Tree) ConditionalVisitPostOrder ¶
ConditionalVisitPostOrder traverses t in post-order (LRN). The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Tree) ConditionalVisitPreOrder ¶
ConditionalVisitPreOrder traverses t in pre-order (NLR). The traversal stops when predicate returns false. It returns true if predicate returns true throughout the travesal; it returns false otherwise.
func (*Tree) VisitInOrder ¶
func (t *Tree) VisitInOrder(consumer func(interface{}))
VisitInOrder traverses t in in-order (LNR).
func (*Tree) VisitNodeInOrder ¶
VisitNodeInOrder traverses t in in-order (LNR). Any nil children of leaf nodes are also traversed.
func (*Tree) VisitNodePostOrder ¶
VisitNodePostOrder traverses t in post-order (LRN). Any nil children of leaf nodes are also traversed.
func (*Tree) VisitNodePreOrder ¶
VisitNodePreOrder traverses t in pre-order (NLR). Any nil children of leaf nodes are also traversed.
func (*Tree) VisitPostOrder ¶
func (t *Tree) VisitPostOrder(consumer func(interface{}))
VisitPostOrder traverses t in post-order (LRN).
func (*Tree) VisitPreOrder ¶
func (t *Tree) VisitPreOrder(consumer func(interface{}))
VisitPreOrder traverses t in pre-order (NLR).