Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Lee-Hiter committed Aug 19, 2016
1 parent a667d82 commit 77fb901
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion heapSort.py
Expand Up @@ -8,7 +8,7 @@ def heapSort(alist):
for j in range(tempLen//2-1, -1, -1):
preIndex = j
preVal, heap = alist[preIndex], False
while 2 * preIndex <= tempLen - 1 and not heap:
while 2 * preIndex < tempLen - 1 and not heap:
curIndex = 2 * preIndex + 1
if curIndex < tempLen - 1:
if alist[curIndex] < alist[curIndex+1]:
Expand Down

0 comments on commit 77fb901

Please sign in to comment.