Compare sorting algorithms' performance: Difference between revisions
Content added Content deleted
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: | Line 2,720: | ||
end /*j*/; return |
end /*j*/; return |
||
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
/*──────────────────────────────────────────────────────────────────────────────────────*/ |
||
shell: procedure expose @.; parse arg N /*obtain the N from the argument list*/ |
shell: procedure expose @.; parse arg N /*obtain the N from the argument list*/ |
||
i= N % 2 /*% is integer division in REXX. */ |
i= N % 2 /*% is integer division in REXX. */ |
||
do while i\==0 |
do while i\==0 |
||
do j=i+1 to N; k= j; p= k-i /*P: previous item*/ |
do j=i+1 to N; k= j; p= k-i /*P: previous item*/ |
||
_= @.j |
_= @.j |
||
do while k>=i+1 & @.p>_; |
do while k>=i+1 & @.p>_; @.k= @.p; k= k-i; p= k-i |
||
@.k= @.p; |
|||
k= k-i; |
|||
p= k-i |
|||
end /*while k≥i+1*/ |
end /*while k≥i+1*/ |
||
@.k= _ |
@.k= _ |
||
end /*j*/ |
end /*j*/ |
||
if i==2 then i= 1 |
if i==2 then i= 1 |
||
else i= i * 5 % 11 |
else i= i * 5 % 11 |
||
end |
end /*while i¬==0*/; return</lang> |
||
{{out|output|text= when using the default inputs:}} |
{{out|output|text= when using the default inputs:}} |
||