Skip to content

Commit 9f5abb3

Browse files
committed
refactor(datastructures, trees): add return type
1 parent 1254903 commit 9f5abb3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

datastructures/trees/binary/search_tree/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def inorder(node: BinaryTreeNode):
361361

362362
return result.right
363363

364-
def in_order_recurse(self, node: BinaryTreeNode):
364+
def in_order_recurse(self, node: BinaryTreeNode) -> List[T]:
365365
"""
366366
Another type of Depth First Search (DFS) that traverses the tree from the left to middle to right of the tree.
367367
This type of search will begin at the left node and check if that node has a left child and continually check
@@ -378,6 +378,7 @@ def in_order_recurse(self, node: BinaryTreeNode):
378378

379379
if self.root.right:
380380
self.in_order_recurse(self.root.right)
381+
return result
381382

382383
def in_order_iterate(self) -> list:
383384
"""

0 commit comments

Comments
 (0)