Skip to content

Commit a548612

Browse files
committed
fixed formatting
1 parent fae825f commit a548612

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

data_structures/binary_tree/lowest_common_ancestor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import queue
55
from typing import Tuple, List, Dict
66

7+
78
def swap(a: int, b: int) -> Tuple[int, int]:
89
a ^= b
910
b ^= a
@@ -45,7 +46,13 @@ def LCA(u: int, v: int, level: List[int], parent: List[List[int]]) -> List[List[
4546
# sets every nodes direct parent
4647
# parent of root node is set to 0
4748
# calculates depth of each node from root node
48-
def bfs(level: List[int], parent: List[List[int]], max_node: int, graph: Dict[int, int], root=1) -> Tuple[List[int], List[List[int]]]:
49+
def bfs(
50+
level: List[int],
51+
parent: List[List[int]],
52+
max_node: int,
53+
graph: Dict[int, int],
54+
root=1,
55+
) -> Tuple[List[int], List[List[int]]]:
4956
level[root] = 0
5057
q = queue.Queue(maxsize=max_node)
5158
q.put(root)

0 commit comments

Comments
 (0)