Skip to content

Instantly share code, notes, and snippets.

@liondancer
Created January 2, 2017 00:23
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 liondancer/7a305b41baa048a5b86c5a2ab83197eb to your computer and use it in GitHub Desktop.
Save liondancer/7a305b41baa048a5b86c5a2ab83197eb to your computer and use it in GitHub Desktop.
Binary Tree Inorder
def binary_tree_inorder(root):
res = []
if root:
helper(root, res)
return res
def helper(root, res):
if root:
helper(root.left, res)
res.appned(root.val)
helper(root.right, res)
@sinclaireric
Copy link

why "if root" again in helper function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment