Anonymous user
Compare sorting algorithms' performance: Difference between revisions
Compare sorting algorithms' performance (view source)
Revision as of 13:13, 3 September 2021
, 2 years ago→{{header|REXX}}: added wording to the REXX section header, allowd the starting number (of elements) to be specified on the command line.
m (→{{header|REXX}}: recoded/reformated the SHELL sort subroutine to use less whitespace.) |
m (→{{header|REXX}}: added wording to the REXX section header, allowd the starting number (of elements) to be specified on the command line.) |
||
Line 2,462:
=={{header|REXX}}==
One goal for this REXX program was to include as many different sorts (that sorted arrays and not lists).
Because of the disparencies of some sorting algorithms, the range of numbers was chosen to be '''5''' so that the
<br>slower sorts wouldn't consume a lot of time trying to sort larger arrays.
The number of ranges can be increased at the expense of a wider display of output.
<lang rexx>/*REXX pgm compares various sorts for 3 types of input sequences: ones/ascending/random.*/
parse arg ranges start# seed .
if ranges=='' | ranges=="," then ranges= 5 /*Not Specified
if start#=='' | start#=="," then start#= 250 /* " " " " " " */
if seed=='' | seed=="," then seed= 1946 /*use a repeatable seed for RANDOM BIF*/
if datatype(seed, 'W') then call random ,,seed /*Specified? Then use as a RANDOM seed*/
kinds= 3;
do ra=1 for ranges
hdr= hdr || center( commas(#) "numbers", 25)'│' /*(top) header for the output title.*/
do ki=1 for kinds
|