Dequeue all nodes of current level and Enqueue all nodes of next level
while ( nodeCount > 0 ) : NEW_LINE INDENT node = q [ 0 ] NEW_LINE if ( isOdd ) : NEW_LINE INDENT print ( node . data , end = " ▁ " ) NEW_LINE DEDENT q . pop ( 0 ) NEW_LINE if ( node . left != None ) : NEW_LINE INDENT q . append ( node . left ) NEW_LINE DEDENT if ( node . right != None ) : NEW_LINE INDENT q . append ( node . right ) NEW_LINE DEDENT nodeCount -= 1 NEW_LINE DEDENT isOdd = not isOdd NEW_LINE