Skip to content

Instantly share code, notes, and snippets.

Created April 12, 2011 15:06
Show Gist options
  • Save anonymous/915670 to your computer and use it in GitHub Desktop.
Save anonymous/915670 to your computer and use it in GitHub Desktop.
def printexp(tree):
sVal = ""
if tree:
sVal = '(' + printexp(tree.getLeftChild())
sVal = sVal + str(tree.getRootVal())
sVal = sVal + printexp(tree.getRightChild())+')'
return sVal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment