Skip to content

Commit 77fb901

Browse files
fix bug
1 parent a667d82 commit 77fb901

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

heapSort.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def heapSort(alist):
88
for j in range(tempLen//2-1, -1, -1):
99
preIndex = j
1010
preVal, heap = alist[preIndex], False
11-
while 2 * preIndex <= tempLen - 1 and not heap:
11+
while 2 * preIndex < tempLen - 1 and not heap:
1212
curIndex = 2 * preIndex + 1
1313
if curIndex < tempLen - 1:
1414
if alist[curIndex] < alist[curIndex+1]:

0 commit comments

Comments
 (0)