1. For example if the inputs are:

Example:1

a)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/77bd3ad0-e785-474d-bf64-a907935ef29a/Untitled.png

b)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9d6cb66b-f95e-4936-9107-9c2526757460/Untitled.png

Output should be true.

Example:2

If the inputs are:

a)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a7d985f4-9d9a-4347-ac6f-f49793726b5c/Untitled.png

b)

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f8527c98-4315-43b4-861a-552d1435f008/Untitled.png

Output should be false.

Pseudo code for the same:

boolean sameTree(node root1, node root2){

if(root1 == NULL && root2 == NULL)
return true;

if(root1 == NULL || root2 == NULL)
return false;

if(root1->data == root2->data 
     && sameTree(root1->left,root2->left)
        && sameTree(root1->right, root2->right))
return true;

}