Function to do preorder traversal of tree
def preOrder ( root ) : NEW_LINE INDENT if not root : NEW_LINE INDENT return NEW_LINE DEDENT print ( " { } ▁ " . format ( root . data ) , end = " " ) NEW_LINE preOrder ( root . left ) NEW_LINE preOrder ( root . right ) NEW_LINE DEDENT