Sorting algorithms/Heapsort: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed the default array from a modern Greek alphabet to an epichoric alphabet, added/changed comments and whitespace, added whitespace before assignments (that have literals).)
m (→‎{{header|REXX}}: added wording to the first two REXX section headers.)
Line 3,158:
 
=={{header|REXX}}==
===version 1, elements of an array===
This REXX version uses a heapsort to sort elements of an array, the elements can be numbers or character strings   (or a mixture of both).
 
Indexing of the array (for this version) starts with   '''1'''   (one),   but can be programmed to start with zero.
Line 3,247:
</pre>
 
===version 2, elements of a list===
This REXX version creates a stemmed array from a list &nbsp; (it can be numbers or characters, or a mixture of both).
<lang rexx>/*REXX pgm sorts an array (names of epichoric Greek letters) using a heapsort algorithm.*/
parse arg g /*obtain optional arguments from the CL*/