menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Check if g...
source image

Prodevelopertutorial

1w

read

342

img
dot

Image Credit: Prodevelopertutorial

Check if given two nodes are siblings to each other in Binary Tree

  • Given a binary tree root node and 2 node values, check if those 2 nodes are siblings.
  • If the node values are 7 and 15, they are siblings; if the node values are 7 and 18, they are not siblings.
  • The solution involves checking the children of each node to see if they match the given node values.
  • If a match is found, return true; otherwise, return false.

Read Full Article

like

20 Likes

For uninterrupted reading, download the app