-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
43 lines (36 loc) · 773 Bytes
/
main.py
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
36
37
38
39
40
41
42
43
"""
Author: Mannuel Victor Di Pace Maroja Limeira
#IFRN: 20121014040067
AVL Tree implementation - Data Structure
IFRN - Natal/RN - Brazil
2015
Contact: [email protected]
"""
from avl import *
if __name__ == '__main__':
## Left rotation
# avl = AVL(30)
# avl.insert(40)
# avl.insert(29)
# avl.insert(39)
# avl.insert(41)
# avl.insert(43)
# avl.print_visual_tree()
## Right rotation
# avl = AVL(30)
# avl.insert(29)
# avl.insert(39)
# avl.insert(28)
# avl.insert(27)
# avl.insert(26)
# avl.print_visual_tree()
## Left-Right rotation
# avl = AVL(30)
# avl.insert(28)
# avl.insert(29)
# avl.print_visual_tree()
## Right-Left rotation
avl = AVL(30)
avl.insert(32)
avl.insert(31)
avl.print_visual_tree()