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

Function NewBTree

structure/tree/btree.go:35–43  ·  view source on GitHub ↗
(maxKeys int)

Source from the content-addressed store, hash-verified

33}
34
35func NewBTree[T constraints.Ordered](maxKeys int) *BTree[T] {
36 if maxKeys <= 2 {
37 panic("Must be >= 3 keys")
38 }
39 return &BTree[T]{
40 root: nil,
41 maxKeys: maxKeys,
42 }
43}
44
45func (node *BTreeNode[T]) Verify(tree *BTree[T]) {
46 minKeys := minKeys(tree.maxKeys)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected