Sorting algorithms/Heapsort: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: added wording to the first two REXX section headers.)
(→‎{{header|Javascript}}: This line was broken in the conversion from CS)
Line 1,950: Line 1,950:
function heap_sort(arr) {
function heap_sort(arr) {
put_array_in_heap_order(arr);
put_array_in_heap_order(arr);
end = arr.length - 1;
var end = arr.length - 1;
while(end > 0) {
while(end > 0) {
swap(arr, 0, end);
swap(arr, 0, end);