We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de9a8c8 commit 1dce053Copy full SHA for 1dce053
1 file changed
Identical_tree
@@ -0,0 +1,18 @@
1
+class Node:
2
+
3
+ def __init__(self, data):
4
+ self.data=data
5
+ self.left=None
6
+ self.right=None
7
8
9
+def is_identical(root1,root2):
10
+ if(root1 == None and root2 == None):
11
+ return True
12
+ if(root1 != None and root2 != None and root1.data == root2.data):
13
+ l = is_identical(root1.left , root2.left)
14
+ r = is_identical(root1.right, root2.right)
15
+ if(l and r):
16
17
+ return False
18
0 commit comments