menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Check if 2...
source image

Prodevelopertutorial

1M

read

389

img
dot

Image Credit: Prodevelopertutorial

Check if 2 nodes are mirror of each other

  • To check if two trees are mirror to each other, we need to compare the following conditions:
  • 1. The left child of tree 1 should be equal to the right child of tree 2.
  • 2. The right child of tree 1 should be equal to the left child of tree 2.
  • 3. If both trees have no children (NULL), they are considered mirror trees.

Read Full Article

like

23 Likes

For uninterrupted reading, download the app