We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c169a10 commit a5b4858Copy full SHA for a5b4858
1 file changed
binary_mirror
@@ -0,0 +1,22 @@
1
+class Node:
2
+ def __init__(self,data):
3
+ self.data=data
4
+ self.left=None
5
+ self.right=None
6
+
7
+def get_mirror(root):
8
+ if(root == None):
9
+ return
10
+ get_mirror(root.left)
11
+ get_mirror(root.right)
12
13
+ temp=root.left
14
+ root.left=root.right
15
+ root.right=temp
16
17
+def preorder(root):
18
+ if(root==None):
19
20
+ print(root.data, end=" ")
21
+ preorder(root.left)
22
+ preorder(root.right)
0 commit comments