The input to the function/method consists of two arguments:
root1, a node of the head of the binary tree representing the larger tree of the
organization:
root2. a node of the head of the second binary tree representing the smaller tree.
Output
Return an integer '1'if root2 is a subtree of root1. Otherwise, return -1.
Note
Compare the trees using the integer values of the nodes and NOT the objects of the
node themselves. Assume the integer values in the nodes are unique in each of the
trees
Example
Example 1:
Input
roots
root=16
1517
Answers
Answered by
2
Answer:
give the question in photo
Similar questions