Anonymous user
Compare sorting algorithms' performance: Difference between revisions
Compare sorting algorithms' performance (view source)
Revision as of 12:44, 3 September 2021
, 2 years ago→{{header|REXX}}: recoded/reformated the SHELL sort subroutine to use less whitespace.
m (→{{header|REXX}}: changed the font-size for the output section.) |
m (→{{header|REXX}}: recoded/reformated the SHELL sort subroutine to use less whitespace.) |
||
Line 2,720:
end /*j*/; return
/*──────────────────────────────────────────────────────────────────────────────────────*/
shell: procedure expose @.; parse arg N /*obtain the N from the argument list*/
i= N % 2 /*% is integer division in REXX. */
do while i\==0
do j=i+1 to N; k= j; p= k-i /*P: previous item*/
_= @.j
do while k>=i+1 & @.p>_; @.k= @.p; k= k-i; p= k-i
end /*while k≥i+1*/
@.k= _
end /*j*/
if i==2 then i= 1
else i= i * 5 % 11
end
{{out|output|text= when using the default inputs:}}
|