The code given in geeks for geeks doesn’t work for this input
node1=Node(10)
node2=Node(20)
node3=Node(25)
node4=Node(30)
node5=Node(40)
node6=Node(40)
node7=Node(50)
node8=Node(50)
node9=Node(32)
node10=Node(20)
node11=Node(21)
node12=Node(12)
node1.left=node2
node1.right=node3
node2.left=node4
node2.right=node5
node3.left=node6
node3.right=node7
node5.right=node8
node6.left=node9
node8.left=node10
node9.left=node11
node9.right=node12