Last active
June 27, 2021 07:36
-
-
Save fpaupier/f9750a7d94f0ba87ab7b07d7f55828af to your computer and use it in GitHub Desktop.
Inorder traversal of a tree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def inorder(n: 'TreeNode') -> None: | |
if n == None: | |
return | |
inorder(n.left) | |
# Node processing: here simple print | |
print(n.val) | |
inorder(n.right) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment