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

Method Verify

structure/tree/btree.go:45–52  ·  view source on GitHub ↗
(tree *BTree[T])

Source from the content-addressed store, hash-verified

43}
44
45func (node *BTreeNode[T]) Verify(tree *BTree[T]) {
46 minKeys := minKeys(tree.maxKeys)
47 if node != tree.root && node.numKeys < minKeys {
48 panic("node has too few keys")
49 } else if node.numKeys > tree.maxKeys {
50 panic("node has too many keys")
51 }
52}
53
54func (node *BTreeNode[T]) IsFull(maxKeys int) bool {
55 return node.numKeys == maxKeys

Callers 2

InsertNonFullMethod · 0.95
DeleteMethod · 0.95

Calls 1

minKeysFunction · 0.85

Tested by

no test coverage detected