Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ _depth
Method
_depth
data_structures/binary_tree/basic_binary_tree.py:88–91 ·
view source on GitHub ↗
(self, node: Node | None)
Source
from the content-addressed store, hash-verified
86
return
self._depth(self.root)
87
88
def
_depth(self, node: Node | None) -> int:
89
if
not node:
90
return
0
91
return
1 + max(self._depth(node.left), self._depth(node.right))
92
93
def
is_full(self) -> bool:
94
""
"
Callers
1
depth
Method · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected