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

Method leaf_count

python/bplustree/bplus_tree.py:617–624  ·  view source on GitHub ↗

Return the number of leaf nodes

(self)

Source from the content-addressed store, hash-verified

615 """Testing only"""
616
617 def leaf_count(self) -> int:
618 """Return the number of leaf nodes"""
619 count = 0
620 node = self.leaves
621 while node is not None:
622 count += 1
623 node = node.next
624 return count
625
626 def _count_total_nodes(self) -> int:
627 """Count total nodes in the tree (for testing/debugging)"""

Calls

no outgoing calls