-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.9.py
More file actions
35 lines (26 loc) · 633 Bytes
/
4.9.py
File metadata and controls
35 lines (26 loc) · 633 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
data = {
2 : [1, 3],
1 : [],
3 : []
}
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def left (self, node):
self.left = node
def right (self, node):
self.right = node
class BST:
def __init__(self, root):
self.root = root
def insert (self, node):
current = self.root
while node.data > current.data:
current.right
def in_order_list (root, list):
in_order_list(root.left, list)
list.append(root)
in_order_list(root.right, list)
print(list)