Skip to content

Instantly share code, notes, and snippets.

@sreevidyavutukuru
Created August 10, 2017 02:44
Show Gist options
  • Save sreevidyavutukuru/7f33696015ac13cfdae747dfd6042e8f to your computer and use it in GitHub Desktop.
Save sreevidyavutukuru/7f33696015ac13cfdae747dfd6042e8f to your computer and use it in GitHub Desktop.
def PostOrder(self,root):
if root!= None:
print root.val
if root.left!= None:
self.PostOrder(root.left)
if root.right!=None:
self.PostOrder(root.right)
else:
return
def InOrder(self,root):
if root!= None:
if root.left!= None:
self.PostOrder(root.left)
print root.val
if root.right!=None:
self.PostOrder(root.right)
else:
return
def PostOrder(self,root):
if root!= None:
if root.left!= None:
self.PostOrder(root.left)
if root.right!=None:
self.PostOrder(root.right)
print root.val
else:
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment