Anonymous user
Sorting algorithms/Heapsort: Difference between revisions
m
→{{header|C}}: use for loops instead of while statements.
(Added C) |
m (→{{header|C}}: use for loops instead of while statements.) |
||
Line 142:
int start, end;
/* heapify */
siftDown( a, start, count);
}
SWAP(a[end],a[0]);
siftDown(a, 0, end);
}
}
Line 182 ⟶ 178:
-18.0, 88.1, 30.44, -37.2, 3012.0, 49.2};
#define VSIZE (sizeof(valsToSort)/sizeof(valsToSort[0]))
heapsort(valsToSort, VSIZE);
printf("{");
|