Skip to content
Snippets Groups Projects
Commit cbdf863b authored by nilsl99's avatar nilsl99
Browse files

Added Testing for Aufgabe02.py

parent dd0be089
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
from Aufgabe02 import HeapSort, InsertionSort, CountingSort
import random
```
%% Cell type:code id: tags:
``` python
num_list = range(10, 100)
for i in range(5):
array = random.choices(num_list, k=20)
print("")
print(array, "Unsortiert")
print(sorted(array), "Python sortiert")
print(HeapSort(array), "HeapSort")
print(InsertionSort(array), "InsertionSort")
print(CountingSort(array), "CountingSort")
```
%% Output
[43, 71, 75, 35, 77, 81, 98, 92, 41, 13, 87, 15, 83, 23, 97, 90, 64, 55, 27, 80] Unsortiert
[13, 15, 23, 27, 35, 41, 43, 55, 64, 71, 75, 77, 80, 81, 83, 87, 90, 92, 97, 98] Python sortiert
[13, 15, 23, 27, 35, 41, 43, 55, 64, 71, 75, 77, 80, 81, 83, 87, 90, 92, 97, 98] HeapSort
[13, 15, 23, 27, 35, 41, 43, 55, 64, 71, 75, 77, 80, 81, 83, 87, 90, 92, 97, 98] InsertionSort
[13, 15, 23, 27, 35, 41, 43, 55, 64, 71, 75, 77, 80, 81, 83, 87, 90, 92, 97, 98] CountingSort
[68, 19, 33, 99, 26, 16, 23, 78, 34, 64, 50, 32, 87, 58, 23, 96, 10, 41, 83, 32] Unsortiert
[10, 16, 19, 23, 23, 26, 32, 32, 33, 34, 41, 50, 58, 64, 68, 78, 83, 87, 96, 99] Python sortiert
[16, 10, 19, 23, 23, 26, 32, 32, 33, 34, 41, 50, 58, 64, 68, 78, 83, 87, 96, 99] HeapSort
[10, 16, 19, 23, 23, 26, 32, 32, 33, 34, 41, 50, 58, 64, 68, 78, 83, 87, 96, 99] InsertionSort
[10, 16, 19, 23, 23, 26, 32, 32, 33, 34, 41, 50, 58, 64, 68, 78, 83, 87, 96, 99] CountingSort
[24, 12, 16, 85, 66, 65, 65, 96, 21, 33, 80, 72, 60, 17, 58, 33, 35, 72, 67, 54] Unsortiert
[12, 16, 17, 21, 24, 33, 33, 35, 54, 58, 60, 65, 65, 66, 67, 72, 72, 80, 85, 96] Python sortiert
[12, 16, 17, 21, 24, 33, 33, 35, 54, 58, 60, 65, 65, 66, 67, 72, 72, 80, 85, 96] HeapSort
[12, 16, 17, 21, 24, 33, 33, 35, 54, 58, 60, 65, 65, 66, 67, 72, 72, 80, 85, 96] InsertionSort
[12, 16, 17, 21, 24, 33, 33, 35, 54, 58, 60, 65, 65, 66, 67, 72, 72, 80, 85, 96] CountingSort
[63, 55, 70, 96, 56, 15, 85, 72, 32, 60, 59, 62, 43, 56, 77, 83, 24, 13, 99, 45] Unsortiert
[13, 15, 24, 32, 43, 45, 55, 56, 56, 59, 60, 62, 63, 70, 72, 77, 83, 85, 96, 99] Python sortiert
[13, 15, 24, 32, 43, 45, 55, 56, 56, 59, 60, 62, 63, 70, 72, 77, 83, 85, 96, 99] HeapSort
[13, 15, 24, 32, 43, 45, 55, 56, 56, 59, 60, 62, 63, 70, 72, 77, 83, 85, 96, 99] InsertionSort
[13, 15, 24, 32, 43, 45, 55, 56, 56, 59, 60, 62, 63, 70, 72, 77, 83, 85, 96, 99] CountingSort
[51, 57, 88, 75, 87, 52, 35, 56, 42, 33, 37, 87, 18, 74, 74, 47, 91, 39, 12, 82] Unsortiert
[12, 18, 33, 35, 37, 39, 42, 47, 51, 52, 56, 57, 74, 74, 75, 82, 87, 87, 88, 91] Python sortiert
[12, 18, 33, 35, 37, 39, 42, 47, 51, 52, 56, 57, 74, 74, 75, 82, 87, 87, 88, 91] HeapSort
[12, 18, 33, 35, 37, 39, 42, 47, 51, 52, 56, 57, 74, 74, 75, 82, 87, 87, 88, 91] InsertionSort
[12, 18, 33, 35, 37, 39, 42, 47, 51, 52, 56, 57, 74, 74, 75, 82, 87, 87, 88, 91] CountingSort
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment