Two Mirror Trees
Submissions: 13579   Accuracy:

49.96%

  Difficulty: Easy   Marks: 2

Given a Two Binary Trees, write a function that returns true if one is mirror of other, else returns false.


MirrorTree1            

Input:
The task is to complete the method that takes two arguments, roots of two Binary Trees to be checked for mirror.

Output:
The function should return true if first tree is mirror of second.

Constraints:
1 <=T<= 30
1 <= Number of nodes<= 100
1 <= Data of a node<= 1000

Example:
Input:

2
2 2
1 2 R 1 3 L
1 3 R 1 2 L
4 4
10 20 L 10 30 R 20 40 L 20 60 R
10 20 L 10 30 R 20 40 L 20 60 R

Output:
1
0

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Amit Khandelwal
Author: kartik


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.