Sorting algorithms/Shell sort: Difference between revisions

Content added Content deleted
No edit summary
m (→‎{{header|REXX}}: changed height of the output window.)
Line 2,141: Line 2,141:
Historical data note:   the three-character abbreviations were (and probably still are) the
Historical data note:   the three-character abbreviations were (and probably still are) the
<br>official three-character abbreviations for the states of the USA before the advent of ZIP codes.
<br>official three-character abbreviations for the states of the USA before the advent of ZIP codes.

<br>'''ZIP''' = '''Z'''one '''I'''mprovement '''P'''lan. &nbsp; &nbsp; Now-a-days, the USA uses two-character abbreviations.
'''ZIP''' = '''Z'''one '''I'''mprovement '''P'''lan. &nbsp; &nbsp; Now-a-days, the USA uses two-character abbreviations.
<lang rexx>/*REXX program sorts a stemmed array using the shell sort (shellsort) algorithm. */
<lang rexx>/*REXX program sorts a stemmed array using the shell sort (shellsort) algorithm. */
call gen /*generate the array elements. */
call gen /*generate the array elements. */
Line 2,189: Line 2,190:
show: do j=1 for #; say 'element' right(j,length(#)) arg(1)": " @.j; end; return</lang>
show: do j=1 for #; say 'element' right(j,length(#)) arg(1)": " @.j; end; return</lang>
{{out|output|text=&nbsp; when using the (internal) inputs:}}
{{out|output|text=&nbsp; when using the (internal) inputs:}}
<pre style="height:65ex">
<pre style="height:85ex">
element 1 before sort: 3 character abbreviations for states of the USA
element 1 before sort: 3 character abbreviations for states of the USA
element 2 before sort: ===============================================
element 2 before sort: ===============================================