Check if branch has fewer than minimum required keys
(self)
| 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)""" |
no outgoing calls