Skip to content

Commit e55b09e

Browse files
committed
2 parents 122aed6 + b09345d commit e55b09e

File tree

1 file changed

+4
-3
lines changed
  • algorithm/sorting/heap/basic

1 file changed

+4
-3
lines changed

algorithm/sorting/heap/basic/code.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ function heapSort(array, size) {
1111
temp = array[0];
1212
array[0] = array[j];
1313
array[j] = temp;
14-
14+
15+
tracer._notify(0, j);
1516
tracer._select(j);
1617

1718
heapify(array, j, 0);
18-
tracer._print('Swapping elemnts : ' + array[0] + ' & ' + array[j]);
19+
tracer._print('Swapping elements : ' + array[0] + ' & ' + array[j]);
1920

2021
tracer._deselect(j);
2122
}
@@ -43,7 +44,7 @@ function heapify(array, size, root) {
4344

4445
tracer._notify(largest, root);
4546

46-
tracer._print('Swapping elemnts : ' + array[root] + ' & ' + array[largest]);
47+
tracer._print('Swapping elements : ' + array[root] + ' & ' + array[largest]);
4748

4849
heapify(array, size, largest);
4950
}

0 commit comments

Comments
 (0)