MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / RB

Struct RB

structure/tree/rbtree.go:51–54  ·  view source on GitHub ↗

RB represents a Red-Black tree. By default, _NIL = leaf, a dummy variable.

Source from the content-addressed store, hash-verified

49// RB represents a Red-Black tree.
50// By default, _NIL = leaf, a dummy variable.
51type RB[T constraints.Ordered] struct {
52 Root *RBNode[T]
53 _NIL *RBNode[T] // a sentinel value for nil
54}
55
56// NewRB creates a new Red-Black Tree
57func NewRB[T constraints.Ordered]() *RB[T] {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected