Transform: A B C / \ a b Into: A C | a B c
(idx int)
| 217 | // |
| 218 | // a B c |
| 219 | func (node *BTreeNode[T]) Merge(idx int) { |
| 220 | if node.isLeaf { |
| 221 | panic("cannot merge when leaf node is parent") |
| 222 | } |
| 223 | left := node.children[idx] |
| 224 | right := node.children[idx+1] |
| 225 | left.Append(node.keys[idx], right.children[0]) |
| 226 | left.Concat(right, 0) |
| 227 | node.DeleteIthKey(idx) |
| 228 | } |
| 229 | |
| 230 | func (node *BTreeNode[T]) Min() T { |
| 231 | if node.isLeaf { |
no test coverage detected