MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / is_underfull

Method is_underfull

python/bplustree/bplus_tree.py:697–700  ·  view source on GitHub ↗

Check if leaf has fewer than minimum required keys.

(self)

Source from the content-addressed store, hash-verified

695 return len(self.keys)
696
697 def is_underfull(self) -> bool:
698 """Check if leaf has fewer than minimum required keys."""
699 min_keys = (self.capacity - 1) // 2
700 return len(self.keys) < min_keys
701
702 def can_donate(self) -> bool:
703 """Check if leaf can give a key to a sibling (has more than minimum)."""

Callers 1

Calls

no outgoing calls

Tested by 1