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

Method count_nodes

python/bplustree/bplus_tree.py:629–635  ·  view source on GitHub ↗
(node: "Node")

Source from the content-addressed store, hash-verified

627 """Count total nodes in the tree (for testing/debugging)"""
628
629 def count_nodes(node: "Node") -> int:
630 if node.is_leaf():
631 return 1
632 total = 1
633 for child in node.children:
634 total += count_nodes(child)
635 return total
636
637 return count_nodes(self.root)
638

Callers

nothing calls this directly

Calls 1

is_leafMethod · 0.45

Tested by

no test coverage detected