Skip to content

Commit 2e42244

Browse files
author
elliottcf
committed
Make heapSort accept any array length
heapSort was hard-coded to only accept a fixed array length.
1 parent 410dfa1 commit 2e42244

File tree

1 file changed

+1
-1
lines changed
  • algorithm/sorting/heap/basic

1 file changed

+1
-1
lines changed

algorithm/sorting/heap/basic/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ function heapify(array, size, root) {
5353
tracer._sleep(1000);
5454
tracer._pace(800);
5555

56-
heapSort(D, 10);
56+
heapSort(D, D.length);
5757

5858
tracer._print('Final array = [' + D.join(', ') + ']');

0 commit comments

Comments
 (0)