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

Method Concat

structure/tree/btree.go:107–113  ·  view source on GitHub ↗

Add all of other's keys starting from idx and children starting from idx + 1

(other *BTreeNode[T], idx int)

Source from the content-addressed store, hash-verified

105
106// Add all of other's keys starting from idx and children starting from idx + 1
107func (node *BTreeNode[T]) Concat(other *BTreeNode[T], idx int) {
108 for i := 0; i < other.numKeys-idx; i++ {
109 node.keys[node.numKeys+i] = other.keys[i+idx]
110 node.children[node.numKeys+i+1] = other.children[i+idx+1]
111 }
112 node.numKeys += other.numKeys - idx
113}
114
115// Transform:
116//

Callers 2

SplitMethod · 0.80
MergeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected