Skip to content

Commit 88fe5c4

Browse files
committed
Fix typo in Heapsort algorithm
1 parent f745921 commit 88fe5c4

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

algorithm/sorting/heap/basic/code.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function heapSort(array, size) {
1515
tracer._select(j);
1616

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

2020
tracer._deselect(j);
2121
}
@@ -43,7 +43,7 @@ function heapify(array, size, root) {
4343

4444
tracer._notify(largest, root);
4545

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

4848
heapify(array, size, largest);
4949
}

0 commit comments

Comments
 (0)