We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a667d82 commit 77fb901Copy full SHA for 77fb901
heapSort.py
@@ -8,7 +8,7 @@ def heapSort(alist):
8
for j in range(tempLen//2-1, -1, -1):
9
preIndex = j
10
preVal, heap = alist[preIndex], False
11
- while 2 * preIndex <= tempLen - 1 and not heap:
+ while 2 * preIndex < tempLen - 1 and not heap:
12
curIndex = 2 * preIndex + 1
13
if curIndex < tempLen - 1:
14
if alist[curIndex] < alist[curIndex+1]:
0 commit comments