class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
def __str__(self):
return self.value
r'''
A-B
\
C - E
\
D
'''
root = Node("A")
root.left = Node("B")
root.right = Node("C")
root.right.right = Node("D")
root.right.left = Node("E")
def iot(node):
if node is not None:
iot(node.left)
print node
iot(node.right)
iot(root)