Documentation ¶
Index ¶
- Constants
- type MKey
- type MValue
- type Node
- type NodeHandler
- type RBMap
- func (rbm *RBMap) Count() int
- func (rbm *RBMap) Equals(other *RBMap) bool
- func (rbm *RBMap) Get(key MKey) (MValue, bool)
- func (rbm *RBMap) IsEmpty() bool
- func (rbm *RBMap) Keys() (keys []MKey)
- func (rbm *RBMap) Modify(key MKey, val MValue) (*RBMap, bool)
- func (rbm *RBMap) Print()
- func (rbm *RBMap) Put(key MKey, val MValue) *RBMap
- func (rbm *RBMap) Values() (values []MValue)
- func (rbm *RBMap) VisitAll(visitor func(*Node))
Constants ¶
View Source
const ( //RED represents red color of node RED = 0 //BLACK represents black color of node BLACK = 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeHandler ¶
type NodeHandler interface { HandleSameKey(*Node, MKey, MValue) *Node MarkDeletion(*Node, MKey, MValue) (*Node, bool) }
NodeHandler is interface
type RBMap ¶
type RBMap struct { Root *Node Handler NodeHandler // contains filtered or unexported fields }
RBMap is Red-Black tree
func NewRBMapWithHandler ¶
func NewRBMapWithHandler(nhandler NodeHandler) *RBMap
NewRBMapWithHandler returns new map with handler
Click to show internal directories.
Click to hide internal directories.