If the dequeued node has a right child , add it to the queue with a horizontal distance hd + 1.
if ( temp . right != None ) : NEW_LINE INDENT temp . right . hd = hd + 1 NEW_LINE q . append ( temp . right ) NEW_LINE DEDENT