Skip to content

Commit

Permalink
Update dfs-inorder.py
Browse files Browse the repository at this point in the history
  • Loading branch information
the-robot authored Aug 15, 2021
1 parent 0cef4b3 commit 20f58b9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions algorithms/tree/dfs-inorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ def __init__(self, val=0, left=None, right=None):
self.left = left
self.right = right


def inorder(root: TreeNode):
if root == None:
return
Expand All @@ -18,6 +19,7 @@ def inorder(root: TreeNode):
# traverse right
inorder(root.right)


def inorder_iterative(self, root: TreeNode):
stack = []
current = root
Expand Down

0 comments on commit 20f58b9

Please sign in to comment.