Helper function that allocates a new node with the given data and null left and right pointers .
void postorder ( Node head ) { Node temp = root ; HashSet < Node > visited = new HashSet < > ( ) ; while ( ( temp != null && ! visited . contains ( temp ) ) ) {