From 4d6fadba22248a5a1b19d216658bedfe91ec3b35 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Apr 2026 10:17:47 +0200 Subject: [PATCH] fix --- ShellSort.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ShellSort.py b/ShellSort.py index f38be0e..b97606b 100644 --- a/ShellSort.py +++ b/ShellSort.py @@ -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) \ No newline at end of file +ende = time.time() + +if (anzahlElemente <= 20): + print("\nSortiert: ", sortierteListe) +print() +print('{0:5.3f}s'.format(ende-start)) \ No newline at end of file