Browse Source

Updated sorting.py

luislopez66 2 years ago
parent
commit
34f423a384
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      sorting.py

+ 3
- 3
sorting.py View File

@@ -35,11 +35,11 @@ def heapSort(lista):
35 35
 	n = len(lista)
36 36
 	h1 = (n // 2) - 1
37 37
 	for i in range(h1, -1, -1):
38
-		heapify(lista, n, i)
38
+		heapify(lista[i])
39 39
 
40
-	for i in range(h1, -1, -1):
40
+	for i in range(n-1, -1, -1):
41 41
 		lista[i], lista[0] = lista[0], lista[i]
42
-		heapify(lista, i, 0)
42
+		heapify(lista[i])
43 43
 
44 44
 	return lista
45 45