Sorting algorithms/Shell sort: Difference between revisions

m
→‎{{header|REXX}}: changed a variable name, changed DO-end comments.
m (→‎{{header|REXX}}: added whitespace, changed some comments.)
m (→‎{{header|REXX}}: changed a variable name, changed DO-end comments.)
Line 2,789:
return
/*──────────────────────────────────────────────────────────────────────────────────────*/
shellSort: procedure expose @.; parse arg Nn /*obtain the Nn from the argument list*/
i= Nn % 2 /*% is integer division in REXX. */
do while i\==0
do j=i+1 to Nn; k= j; p= k -i 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 /*while i¬==0*/
return
/*──────────────────────────────────────────────────────────────────────────────────────*/