-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
71 lines (47 loc) · 1.03 KB
/
test.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Test File
from main import *
import itertools
from random import *
from sarr import *
from minheap import *
from maxheap import *
from bst import *
def test():
s_data.len = 0
for x in choice([x for x in itertools.permutations(range(100))]):
s_data.add(x)
print(str(s_data.contains(3)) + " should be true")
s_data.remove(3)
print(str(s_data.contains(3)) + " should be false")
print(str(s_data.get(0)) + " should be 0")
s_data = SD()
# --------------
# Array Test
# --------------
print "Testing Unsorted Arrays"
s_data.struct = Arr()
test()
# --------------
# Sorted Array Test
# --------------
print "Testing Sorted Arrays\n"
s_data.struct = SArr()
test()
# --------------
# Max Heap Test
# --------------
print "Testing Min Heap\n"
s_data.struct = MinHeap()
test()
# --------------
# Min Heap Test
# --------------
print "Testing Min Heap\n"
s_data.struct = MaxHeap()
test()
# --------------
# Balanced BST Test
# --------------
print "Testing Balanced BST\n"
s_data.struct = Balanced_BST()
test()