Anonymous user
Sorting algorithms/Comb sort: Difference between revisions
m
→{{header|REXX}}: added/changed comments and whitespace, used a template for the output.
m (→{{header|REXX}}: added/changed comments and whitespace, used a template for the output.) |
|||
Line 1,998:
=={{header|REXX}}==
<lang rexx>/*REXX program sorts and displays a stemmed array using the comb sort algorithm. */
call gen; w=length(#) /*generate the @ array elements. */
Line 2,008 ⟶ 2,007:
/*──────────────────────────────────────────────────────────────────────────────────────*/
combSort: procedure expose @.; parse arg N /*N: is the number of @ elements. */
s=N -
do until
s=
end /*until*/ /* [↑] swap two elements in the array.*/
return
/*──────────────────────────────────────────────────────────────────────────────────────*/
Line 2,032:
return /* [↑] adjust # because of the DO loop*/
/*──────────────────────────────────────────────────────────────────────────────────────*/
show: do
Data
or ''unidecagon'') is from the Greek word
''hendeka'' [eleven] and ''gon─'' [corner]. <br>
<pre style="height:80ex">
element 1 before sort: ----polygon--- sides
|