Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlackViolationValidate ¶
func BlackViolationValidate[K infra.OrderedKey, V any](tree RBTree[K, V]) error
<X> is a RED node. [X] is a BLACK node (or NIL).
[13] / \ <8> [15] / \ / \ [6] [11] [14] [17] / / <1> [16]
2-3-4 tree like:
<8> --- [13] --- <15> / \ / \ / \ / \ <1>-[6][11] [14] <16>-[17]
Each leaf node to root node black depth are equal.
func RedViolationValidate ¶
func RedViolationValidate[K infra.OrderedKey, V any](tree RBTree[K, V]) error
Inorder traversal to validate the rbtree properties.
Types ¶
type RBDirection ¶
type RBDirection int8
const ( Left RBDirection = -1 + iota Root Right )
func (RBDirection) String ¶
func (i RBDirection) String() string
type RBTree ¶
type RBTreeOpt ¶
type RBTreeOpt[K infra.OrderedKey, V any] func(*rbTree[K, V])
func WithRBTreeDesc ¶
func WithRBTreeDesc[K infra.OrderedKey, V any]() RBTreeOpt[K, V]
func WithRBTreeRemoveBorrowSucc ¶
func WithRBTreeRemoveBorrowSucc[K infra.OrderedKey, V any]() RBTreeOpt[K, V]
Click to show internal directories.
Click to hide internal directories.