Documentation ¶
Index ¶
- Constants
- Variables
- type RBTree
- func (r *RBTree[K, V]) Delete(k K)
- func (r *RBTree[K, V]) First() (v V, ok bool)
- func (r *RBTree[K, V]) Get(k K) (v V)
- func (r *RBTree[K, V]) GetWithBool(k K) (v V, ok bool)
- func (r *RBTree[K, V]) Last() (v V, ok bool)
- func (r *RBTree[K, V]) Len() int
- func (a *RBTree[K, V]) Range(callback func(k K, v V) bool)
- func (r *RBTree[K, V]) RangePrev(callback func(k K, v V) bool)
- func (r *RBTree[K, V]) Set(k K, v V)
- func (r *RBTree[K, V]) SetWithPrev(k K, v V) (prev V, replaced bool)
- func (r *RBTree[K, V]) TopMax(limit int, callback func(k K, v V) bool)
- func (r *RBTree[K, V]) TopMin(limit int, callback func(k K, v V) bool)
Constants ¶
View Source
const ( RED color = 1 BLACK color = 2 )
Variables ¶
View Source
var ErrNotFound = errors.New("rbtree: not found value")
Functions ¶
This section is empty.
Types ¶
type RBTree ¶
type RBTree[K constraints.Ordered, V any] struct { // contains filtered or unexported fields }
红黑树
func (*RBTree[K, V]) GetWithBool ¶ added in v0.0.6
从rbtree 找到需要的值
func (*RBTree[K, V]) SetWithPrev ¶
设置
Click to show internal directories.
Click to hide internal directories.