forked from MichalxPZ/AiSD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestsForPlot.py
67 lines (51 loc) · 1.5 KB
/
testsForPlot.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
from sorts import *
algos = [selectionSort, insertionSort, bubbleSort, quickSort, mergeSort, heapSort, countingSort]
def random1(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 100)
return algo(tab)
def random2(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 100)
return algo(tab)
def random3(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 100)
return algo(tab)
def constValue(algo, LENGHT):
tab = [0] * LENGHT
const_val = randint(1, 5)
for i in range(LENGHT):
tab[i] = const_val
return algo(tab)
def descendingOrder(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 200)
tab = sorted(tab, reverse=True)
return algo(tab)
def ascendingOrder(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 200)
tab = sorted(tab)
return algo(tab)
def shapeA(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 200)
half1 = sorted(tab[0:len(tab) // 2])
half2 = sorted(tab[(len(tab) // 2) + 1::], reverse=True)
tab = half1 + half2
return algo(tab)
def shapeV(algo, LENGHT):
tab = [0] * LENGHT
for i in range(LENGHT):
tab[i] = randint(0, 200)
half1 = sorted(tab[0:len(tab) // 2], reverse=True)
half2 = sorted(tab[(len(tab) // 2) + 1::])
tab = half1 + half2
return algo(tab)