Skip to content

Instantly share code, notes, and snippets.

@fpaupier
Last active June 27, 2021 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fpaupier/f9750a7d94f0ba87ab7b07d7f55828af to your computer and use it in GitHub Desktop.
Save fpaupier/f9750a7d94f0ba87ab7b07d7f55828af to your computer and use it in GitHub Desktop.
Inorder traversal of a tree
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