Pop all items one by one . Do following for every popped item a ) prit b ) append its right child c ) append its left child Note that right child is appended first so that left is processed first
pre = None NEW_LINE while ( len ( nodeStack ) ) : NEW_LINE