Pop all items one by one . Do following for every popped item a ) print it b ) push its right child c ) push its left child Note that right child is pushed first so that left is processed first
while ( len ( nodeStack ) > 0 ) : NEW_LINE