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

Function _print_structure

python/tests/test_proper_deletion.py:100–108  ·  view source on GitHub ↗

Helper to print tree structure

(node, level)

Source from the content-addressed store, hash-verified

98
99
100def _print_structure(node, level):
101 """Helper to print tree structure"""
102 indent = " " * level
103 if node.is_leaf():
104 print(f"{indent}Leaf: {len(node.keys)} keys = {node.keys}")
105 else:
106 print(f"{indent}Branch: {len(node.keys)} keys, {len(node.children)} children")
107 for i, child in enumerate(node.children):
108 _print_structure(child, level + 1)
109
110
111if __name__ == "__main__":

Calls 1

is_leafMethod · 0.45

Tested by

no test coverage detected