Skip to content

Commit 438f431

Browse files
author
Nikola Yurukov
committed
[Test] Add Python sample arrays generation scripts
1 parent 9462dc0 commit 438f431

File tree

5 files changed

+111
-0
lines changed

5 files changed

+111
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
l = [-2901939070.965906, 4539462982.372177, -6222008480.049856,
2+
-1400427921.5968666, 9866088144.060883,
3+
-2943107648.529664, 8985474333.11443,
4+
9204710651.257133, 5354113876.8447075,
5+
8122228442.770859, -8121418938.303131,
6+
538431208.3261185, 9913821013.519611,
7+
-8722989752.449871, -3091279426.694975,
8+
7229910558.195713, -2908838839.99403,
9+
2835257231.305996, 3922059795.3656673,
10+
-9298869735.322557]
11+
12+
print(l)
13+
14+
l = sorted(l)
15+
print(l)
16+
a1 = l[19]
17+
a2 = -8722989752.449871
18+
print(str(a1) + " -> " + str(a2))
19+
l[19] = a2
20+
21+
b1 = l[18]
22+
b2 = -9698869735.322557
23+
print(str(b1) + " -> " + str(b2))
24+
l[18] = b2
25+
26+
c1 = l[17]
27+
c2 = -9804710651.257133
28+
print(str(c1) + " -> " + str(c2))
29+
l[17] = c2
30+
31+
print(sorted(l))
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
l = [-2901939070.965906, 4539462982.372177, -6222008480.049856,
2+
-1400427921.5968666, 9866088144.060883, -2943107648.529664, 8985474333.11443,
3+
9204710651.257133, 5354113876.8447075, 8122228442.770859, -8121418938.303131,
4+
538431208.3261185, 9913821013.519611, -8722989752.449871, -3091279426.694975,
5+
7229910558.195713, -2908838839.99403, 2835257231.305996, 3922059795.3656673,
6+
-9298869735.322557]
7+
8+
print(l)
9+
10+
l = sorted(l)
11+
print(l)
12+
a1 = l[19]
13+
a2 = 0
14+
print(str(a1) + " -> " + str(a2))
15+
l[19] = a2
16+
17+
b1 = l[18]
18+
b2 = 0
19+
print(str(b1) + " -> " + str(b2))
20+
l[18] = b2
21+
22+
c1 = l[17]
23+
c2 = 0
24+
print(str(c1) + " -> " + str(c2))
25+
l[17] = c2
26+
27+
print(sorted(l))
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/python3
2+
3+
import random
4+
5+
l = []
6+
for i in range(20):
7+
l.append(random.uniform(-1E10, 1E10))
8+
9+
print(l)
10+
l = sorted(l)
11+
print(l)

fibheap/Test Generator/Merge.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import random
2+
3+
l1 = []
4+
l2 = []
5+
for i in range(20):
6+
l1.append(random.uniform(-1E10, 1E10))
7+
l2.append(random.uniform(-1E10, 1E10))
8+
9+
10+
print(l1)
11+
print(l2)
12+
13+
l = []
14+
l.extend(l1)
15+
l.extend(l2)
16+
17+
print(sorted(l))
18+
19+
'''
20+
[6015943293.071386, -3878285748.0708866, 8674121166.062424, -1528465047.6118088,
21+
7584260716.494843, -373958476.80486107, -6367787695.054295, 6813992306.719868,
22+
5986097626.907181, 9011134545.052086, 7123644338.268343, 2646164210.08445,
23+
4407427446.995375, -888196668.2563229, 7973918726.985172, -6529216482.09644,
24+
6079069259.51853, -8415952427.784341, -6859960084.757652, -502409126.89040375]
25+
[9241165993.258648, -9423768405.578083, 3280085607.6687145, -5253703037.682413,
26+
3858507441.2785892, 9896256282.896187, -9439606732.236805, 3082628799.5320206,
27+
9453124863.59945, 9928066165.458393, 1135071669.4712334, 6380353457.986282,
28+
8329064041.853199, 2382910730.445751, -8478491750.445316, 9607469190.690144,
29+
5417691217.440792, -9698248424.421888, -3933774735.280322, -5984555343.381466]
30+
[-9698248424.421888, -9439606732.236805, -9423768405.578083, -8478491750.445316,
31+
-8415952427.784341, -6859960084.757652, -6529216482.09644, -6367787695.054295,
32+
-5984555343.381466, -5253703037.682413, -3933774735.280322, -3878285748.0708866,
33+
-1528465047.6118088, -888196668.2563229, -502409126.89040375,
34+
-373958476.80486107, 1135071669.4712334, 2382910730.445751, 2646164210.08445,
35+
3082628799.5320206, 3280085607.6687145, 3858507441.2785892, 4407427446.995375,
36+
5417691217.440792, 5986097626.907181, 6015943293.071386, 6079069259.51853,
37+
6380353457.986282, 6813992306.719868, 7123644338.268343, 7584260716.494843,
38+
7973918726.985172, 8329064041.853199, 8674121166.062424, 9011134545.052086,
39+
9241165993.258648, 9453124863.59945, 9607469190.690144, 9896256282.896187,
40+
9928066165.458393]
41+
'''

fibheap/Test Generator/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
These are some Python helper scripts to help generate sample test arrays.

0 commit comments

Comments
 (0)