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 e9c018d commit bd99270Copy full SHA for bd99270
testHeap.js
@@ -0,0 +1,24 @@
1
+ function dispArr(arr) {
2
+ for (var i = 0; i < arr.length; ++i) {
3
+ process.stdout.write(arr[i] + " ");
4
+ if (i % 10 == 9) {
5
+ process.stdout.write("\n");
6
+ }
7
8
+ if (i % 10 != 0) {
9
10
11
12
+
13
+var MAX = 50
14
+var sort = require('./src/sorting/heapsort.js').heapSort;
15
+var values = [];
16
+for (var i = 0; i < MAX; ++i) {
17
+ values[i] = Math.floor(Math.random() * MAX+1);
18
19
20
+console.log('\nBefore: ');
21
+dispArr(values);
22
+console.log('\nAfter: ');
23
24
+dispArr(sort(values));
0 commit comments