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

Method DeleteIthKey

structure/tree/btree.go:196–205  ·  view source on GitHub ↗
(i int)

Source from the content-addressed store, hash-verified

194}
195
196func (node *BTreeNode[T]) DeleteIthKey(i int) {
197 if i >= node.numKeys {
198 panic("deleting out of bounds key")
199 }
200 for j := i; j < node.numKeys-1; j++ {
201 node.keys[j] = node.keys[j+1]
202 node.children[j+1] = node.children[j+2]
203 }
204 node.numKeys--
205}
206
207// Transform:
208//

Callers 2

MergeMethod · 0.95
DeleteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected