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

Method is_underfull

python/bplustree/bplus_tree.py:852–855  ·  view source on GitHub ↗

Check if branch has fewer than minimum required keys

(self)

Source from the content-addressed store, hash-verified

850 return len(self.keys)
851
852 def is_underfull(self) -> bool:
853 """Check if branch has fewer than minimum required keys"""
854 min_keys = (self.capacity - 1) // 2
855 return len(self.keys) < min_keys
856
857 def can_donate(self) -> bool:
858 """Check if branch can give a key to a sibling (has more than minimum)"""

Callers 1

Calls

no outgoing calls

Tested by 1