Documentation
¶
Index ¶
- Constants
- Variables
- type RBTree
- func (rb *RBTree[K, V]) Add(key K, value V) error
- func (rb *RBTree[K, V]) Delete(key K) (V, bool)
- func (rb *RBTree[K, V]) Find(key K) (V, error)
- func (rb *RBTree[K, V]) Iterate(cb func(key K, value V) bool)
- func (rb *RBTree[K, V]) KeyValues() ([]K, []V)
- func (rb *RBTree[K, V]) Set(key K, value V) error
- func (rb *RBTree[K, V]) Size() int
Constants ¶
View Source
const ( Red color = false Black color = true )
Variables ¶
View Source
var ( ErrRBTreeSameRBNode = errors.New("ekit: RBTree不能添加重复节点Key") ErrRBTreeNotRBNode = errors.New("ekit: RBTree不存在节点Key") )
Functions ¶
This section is empty.
Types ¶
type RBTree ¶
func NewRBTree ¶
func NewRBTree[K any, V any](compare ekit.Comparator[K]) *RBTree[K, V]
NewRBTree 构建红黑树
Click to show internal directories.
Click to hide internal directories.