if at any point one root becomes null and the other root is not null , then they are not mirrors . This condition verifies that structures of tree are mirrors of each other .
if ( ! ( root1 == NULL && root2 == NULL ) ) return " No " ; if ( ! st1 . empty ( ) && ! st2 . empty ( ) ) { root1 = st1 . top ( ) ; root2 = st2 . top ( ) ; st1 . pop ( ) ; st2 . pop ( ) ;