Documentation ¶
Overview ¶
Package tree :: tree.go
Index ¶
- type BT
- type BTNode
- func (o *BTNode) Find(v interface{}) BT
- func (o *BTNode) Has(v interface{}) bool
- func (o *BTNode) IsMirror() bool
- func (o *BTNode) IsSymmetric() bool
- func (o *BTNode) Left() BT
- func (o *BTNode) Right() BT
- func (o *BTNode) SetLeft(node BT)
- func (o *BTNode) SetRight(node BT)
- func (o *BTNode) SetValue(v interface{})
- func (o *BTNode) String() string
- func (o *BTNode) Value() interface{}
- type IntBT
- type IntBTNode
- type StrBT
- type StrBTNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BT ¶
type BT interface { Left() BT Right() BT Value() interface{} SetLeft(BT) SetRight(BT) SetValue(interface{}) Find(interface{}) BT Has(interface{}) bool }
BT interface includes basic functions for a binary tree item
type BTNode ¶
type BTNode struct {
// contains filtered or unexported fields
}
BTNode represents a binary tree node
func (*BTNode) IsSymmetric ¶
IsSymmetric checks if a binary tree is symmetric in interative mode.
type IntBTNode ¶
type IntBTNode struct {
BTNode
}
IntBTNode represents an integer (int) binary tree node
func NewIntBTNode ¶
NewIntBTNode constructs an IntBTNode instance
type StrBTNode ¶
type StrBTNode struct {
BTNode
}
StrBTNode represents an integer (int) binary tree node
func NewStrBTNode ¶
NewStrBTNode constructs an StrBTNode instance
Click to show internal directories.
Click to hide internal directories.