MCPcopy Create free account
hub / github.com/amit-davidson/Building-a-NoSQL-database-from-zero / rebalanceRemove

Method rebalanceRemove

Part 7/node.go:331–373  ·  view source on GitHub ↗

rebalanceRemove rebalances the tree after a remove operation. This can be either by rotating to the right, to the left or by merging. First, the sibling nodes are checked to see if they have enough items for rebalancing (>= minItems+1). If they don't have enough items, then merging with one of the s

(unbalancedNode *Node, unbalancedNodeIndex int)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

RemoveMethod · 0.45

Calls 6

getNodeMethod · 0.95
writeNodesMethod · 0.95
rotateRightFunction · 0.70
rotateLeftFunction · 0.70
canSpareAnElementMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected