You are viewing a single comment's thread. Return to all comments →
In python 2 you can use a comma at the end of a print statement to supress newline.
def preOrder(root): if root: print root.data, if root.left: preOrder(root.left) if root.right: preOrder(root.right)
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Preorder Traversal
You are viewing a single comment's thread. Return to all comments →
In python 2 you can use a comma at the end of a print statement to supress newline.