From 7520042ef9c5d056f81a55879ddff598607d2f0d Mon Sep 17 00:00:00 2001 From: marina <138340846+bt3gl-cryptographer@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:18:31 -0700 Subject: [PATCH] Update and rename lowest_common_ancestor.py to bt_lowest_common_ancestor.py --- ...west_common_ancestor.py => bt_lowest_common_ancestor.py} | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) rename trees/{lowest_common_ancestor.py => bt_lowest_common_ancestor.py} (72%) diff --git a/trees/lowest_common_ancestor.py b/trees/bt_lowest_common_ancestor.py similarity index 72% rename from trees/lowest_common_ancestor.py rename to trees/bt_lowest_common_ancestor.py index eebb9f6..fdc1a1f 100644 --- a/trees/lowest_common_ancestor.py +++ b/trees/bt_lowest_common_ancestor.py @@ -2,12 +2,10 @@ # -*- coding: utf-8 -*- # author: bt3gl -''' -Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. -''' class Tree: - def lowest_common_ancestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode': + + def lowest_common_ancestor(self, root, p, q): def dfs(root, p, q):