mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-05-23 08:51:31 -04:00
Update and rename find_max_depth_tree.py to bt_find_max_depth.py
This commit is contained in:
parent
e0d9624032
commit
a0b0090f8a
1 changed files with 1 additions and 1 deletions
|
@ -1,10 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# author: bt3gl
|
||||
|
||||
def max_depth(root: Optional[TreeNode]) -> int:
|
||||
|
||||
if root is None:
|
||||
return 0
|
||||
|
||||
return max(max_depth(root.left) + 1, max_depth(root.right) + 1)
|
Loading…
Add table
Add a link
Reference in a new issue