Jump to content

Compare sorting algorithms' performance: Difference between revisions

m
→‎{{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
 
@.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 /*while i¬==0*/; return</lang>
{{out|output|text=&nbsp; when using the default inputs:}}
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.