Answer:
bool identicaltrees(Node* root1,Node* root2)//function of type boolean true if idenctical false if not.
{
if(root1==NULL&&root2==NULL)//both trees are null means identical.
return true;
if(roo1 && root2)
{
if(root1->data==root2->data)//condition for recursive call..
{
return (identicaltrees(root1->left,root2->right)&&identicaltrees(root1->right&&root2->right);
}
}
else
return false;
}
Explanation:
In this function it of type boolean returns true if both the trees are identical return false if not.First we are checking root node of both the trees if both are null then they are identical returning true.
If both root nodes are not null then checking their data.If data is same then recursively traversing on both trees and checking both trees.
else returning false.
Answer:
THE OPERATING SYSTEM (OS)
Explanation:
Design a ringtone like it says
Answer:
The first value of i is 0 and last value of i is 20.
Explanation:
The following are the description of a given loop.
- In this problem, there are two loops one is the internal loop and the other is the external loop
- In the outer loop, the value of " i" is initialized with "0" So the first value is printed 0 in the console.
- For one value of "i" all the inner loop is executed.
- The loop is executed is less equal to 20 that's why the last value of "i" is printed 20 in the console window.