def ipostorder(self):
children = [self, ]<EOL>seen = set()<EOL>while children:<EOL><INDENT>cur_node = children[-<NUM_LIT:1>]<EOL>if cur_node not in seen:<EOL><INDENT>seen.add(cur_node)<EOL>children.extend(reversed(cur_node.children))<EOL><DEDENT>else:<EOL><INDENT>children.pop()<EOL>yield cur_node<EOL><DEDENT><DEDENT>
Depth-first post-order iteration of tree nodes