Documentation
¶
Index ¶
- Constants
- type LLRBTNode
- func (node *LLRBTNode) ColorChange()
- func (node *LLRBTNode) Delete(value int64) *LLRBTNode
- func (node *LLRBTNode) DeleteMin() *LLRBTNode
- func (node *LLRBTNode) Find(value int64) *LLRBTNode
- func (node *LLRBTNode) FindMaxValue() *LLRBTNode
- func (node *LLRBTNode) FindMinValue() *LLRBTNode
- func (node *LLRBTNode) FixUp() *LLRBTNode
- func (node *LLRBTNode) IsRed() bool
- func (node *LLRBTNode) MidOrder()
- func (node *LLRBTNode) RotateLeft() *LLRBTNode
- func (node *LLRBTNode) RotateRight() *LLRBTNode
- type LLRBTree
Constants ¶
View Source
const ( RED = true BLACK = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LLRBTNode ¶
type LLRBTNode struct { Value int64 // 值 Times int64 // 值出现的次数 Left *LLRBTNode // 左子树 Right *LLRBTNode // 右子树 Color bool // 父亲指向该节点的链接颜色 }
LLRBTNode 左倾红黑树节点
func MoveRedLeft ¶
MoveRedLeft 红色左移 节点 h 是红节点,其左儿子和左儿子的左儿子都为黑节点,左移后使得其左儿子或左儿子的左儿子有 一个是红色节点
func (*LLRBTNode) FindMaxValue ¶
func (*LLRBTNode) FindMinValue ¶
type LLRBTree ¶
type LLRBTree struct {
Root *LLRBTNode
}
LLRBTree 左倾红黑树
func NewLLRBTree ¶
func NewLLRBTree() *LLRBTree
func (*LLRBTree) FindMaxValue ¶
FindMaxValue 找出最大值的节点
func (*LLRBTree) FindMinValue ¶
FindMinValue 找出最小值的节点
Click to show internal directories.
Click to hide internal directories.