fix
This commit is contained in:
1 parent
3a90e78f94
commit
4d6fadba22
1 file changed
+11
-3
+11
-3
@@ -1,6 +1,7 @@
|
||||
import random
|
||||
import time
|
||||
|
||||
anzahlElemente = 10
|
||||
anzahlElemente = 20
|
||||
zahlenListe = [random.randint(1, anzahlElemente - 1) for _ in range(anzahlElemente)]
|
||||
output = False
|
||||
|
||||
@@ -30,7 +31,14 @@ def shell_sort(zahlenListe):
|
||||
|
||||
return zahlenListe
|
||||
|
||||
if (anzahlElemente <= 20):
|
||||
print("Unsortiert:", zahlenListe)
|
||||
|
||||
print("Unsortiert:", zahlenListe)
|
||||
start = time.time()
|
||||
sortierteListe = shell_sort(zahlenListe)
|
||||
print("\nSortiert: ", sortierteListe)
|
||||
ende = time.time()
|
||||
|
||||
if (anzahlElemente <= 20):
|
||||
print("\nSortiert: ", sortierteListe)
|
||||
print()
|
||||
print('{0:5.3f}s'.format(ende-start))
|
||||
Reference in new issue
Block a user