Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Pinterest
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Check If One Binary is Mirror Tree of another Binary Tree.

Objec­tive: - Given two binary trees check if they are mir­ror image of each other.





  • Do the pre­order tra­ver­sal on both the trees simultaneously.
  • if any node doesn’t have cor­re­spond­ing node in the another tree, return false.
  • check if left node in one tree is the right node in another tree, and vice verse.



Is Mirror Trees : true

You may also like...

  • san­jib

    add data check for com­plete­ness of the pro­gram
    if( !{

    return false;


    • tuto­ri­al­hori­zon

      Thanks san­jib, updated it 🙂

  • Shilpi

    data check should be done after null check