Skip to content

Commit edbd6a2

Browse files
Merge pull request #10 from AladdinPerzon/UpdateMaster
update
2 parents 09b4af3 + 2359935 commit edbd6a2

File tree

8 files changed

+132
-0
lines changed

8 files changed

+132
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# with open('p01_c.txt') as f_capacity:
2+
# capacity = int(f_capacity.readline())
3+
#
4+
# with open('p01_p.txt') as f_values:
5+
# values = []
6+
#
7+
# for line in f_values:
8+
# values.append(int(line))
9+
#
10+
# with open('p01_w.txt') as f_weights:
11+
# weights = []
12+
#
13+
# for line in f_weights:
14+
# weights.append(int(line))
15+
#
16+
# num_objects = len(weights)
17+
# start1=time.time()
18+
# total_val, items = knapsack(num_objects, capacity, weights, values, [])
19+
# print(items)
20+
#
21+
# print(total_val)
22+
#
23+
# print(time.time()-start1)
24+
# print(KS.knapsack(weights,values).solve(capacity))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
165
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
92
2+
57
3+
49
4+
68
5+
60
6+
43
7+
67
8+
84
9+
87
10+
72
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
23
2+
31
3+
29
4+
44
5+
53
6+
38
7+
63
8+
85
9+
89
10+
82
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6404180
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
825594
2+
1677009
3+
1676628
4+
1523970
5+
943972
6+
97426
7+
69666
8+
1296457
9+
1679693
10+
1902996
11+
1844992
12+
1049289
13+
1252836
14+
1319836
15+
953277
16+
2067538
17+
675367
18+
853655
19+
1826027
20+
65731
21+
901489
22+
577243
23+
466257
24+
369261
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
382745
2+
799601
3+
909247
4+
729069
5+
467902
6+
44328
7+
34610
8+
698150
9+
823460
10+
903959
11+
853665
12+
551830
13+
610856
14+
670702
15+
488960
16+
951111
17+
323046
18+
446298
19+
931161
20+
31385
21+
496951
22+
264724
23+
224916
24+
169684
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# import alla sorting algoritms
2+
3+
L1 = [1,2,3,4,5,6,7,8,9]
4+
L1_sorted = []
5+
L2 = [9,8,7,6,5,4,3,2,1]
6+
L2_sorted = []
7+
L3 = [1,1,1,1,1,1,1,1,1]
8+
L3_sorted = []
9+
L4 = [6,7,3,5,1,3]
10+
L4_sorted = [1,3,3,5,6,7]
11+
L5 = []
12+
L5_sorted = []
13+
14+
15+
# Bubblesort
16+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
17+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
18+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
19+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
20+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
21+
22+
# Selectionsort
23+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
24+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
25+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
26+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
27+
assert sorted(L4) == L4_sorted, "Not correctly sorted"
28+
29+
# Heapsort
30+
31+
# Quicksort
32+
33+
# Mergesort
34+
35+
if __name__ == '__main__':
36+
pass
37+
#run_tests()
38+
#print("All tests OK!")

0 commit comments

Comments
 (0)