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

Method get_depth

python/tests/fuzz_test.py:125–130  ·  view source on GitHub ↗
(node, current_depth=0)

Source from the content-addressed store, hash-verified

123 """Calculate the depth of the tree"""
124
125 def get_depth(node, current_depth=0):
126 if node.is_leaf():
127 return current_depth
128 if not node.children:
129 return current_depth
130 return max(get_depth(child, current_depth + 1) for child in node.children)
131
132 return get_depth(self.btree.root)
133

Callers

nothing calls this directly

Calls 1

is_leafMethod · 0.45

Tested by

no test coverage detected