From 5bca91d990be95f40801a047e043f197303d1517 Mon Sep 17 00:00:00 2001 From: Nils Liebreich <nilsl99@zedat.fu-berlin.de> Date: Sun, 6 Nov 2022 14:23:47 +0100 Subject: [PATCH] Fixed HeapSort --- Aufgabe02.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Aufgabe02.py b/Aufgabe02.py index 23a59fe..696c791 100644 --- a/Aufgabe02.py +++ b/Aufgabe02.py @@ -25,7 +25,7 @@ def HeapSort(array): j = p(j) # Entferne max aus dem max-Heap - for i in range(len(sorted_array)-1, 1, -1): + for i in range(len(sorted_array)-1, 0, -1): sorted_array[0], sorted_array[i] = sorted_array[i], sorted_array[0] j = 0 while True: -- GitLab