[ create a new paste ] login | about

Link: http://codepad.org/MXXPa9bQ    [ raw code | output | fork ]

Python, pasted on Feb 16:
1
2
3
4
5
6
7
8
9
10
11
12
13
class Node:
    def __init__(self, data):
        self.data = data
        self.left = None
        self.right = None

root = Node('foo')
root.left = Node('bar')
root.right = Node('baz')

print(root.data)
print(root.left.data)
print(root.right.data)


Output:
1
2
3
foo
bar
baz


Create a new paste based on this one


Comments: