Helper function that allocates a new node with the given data and NULL left and right pointers .
def postorder ( head ) : NEW_LINE INDENT temp = head NEW_LINE visited = set ( ) NEW_LINE while ( temp and temp not in visited ) : NEW_LINE DEDENT