mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-06-19 04:19:26 -04:00
Update lowest_common_ancestor.py
This commit is contained in:
parent
da0f3fd5d8
commit
c64f3318f8
1 changed files with 1 additions and 1 deletions
|
@ -3,7 +3,7 @@ Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in
|
||||||
'''
|
'''
|
||||||
|
|
||||||
class ThisTree:
|
class ThisTree:
|
||||||
def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
|
def lowest_common_ancestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':
|
||||||
|
|
||||||
def dfs(root, p, q):
|
def dfs(root, p, q):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue