Sorting algorithms/Bubble sort: Difference between revisions
Content added Content deleted
m (→version 3, random integers, horizontal list, with interim plots: changed a comment.) |
m (→version 3, random integers, horizontal list, with interim plots: elided a stray character.) |
||
Line 3,931: | Line 3,931: | ||
if N=='' | N=="," then N=30 /*Not specified? Then use the default.*/ |
if N=='' | N=="," then N=30 /*Not specified? Then use the default.*/ |
||
if datatype(seed, 'W') then call random ,,seed /*An integer? Use the seed for RANDOM.*/ |
if datatype(seed, 'W') then call random ,,seed /*An integer? Use the seed for RANDOM.*/ |
||
call gen N /*generate the array elements (items). */ |
|||
call show 'before sort:' /*show the before array elements. */ |
call show 'before sort:' /*show the before array elements. */ |
||
$$= $ /*keep "before" copy for after the sort*/ |
$$= $ /*keep "before" copy for after the sort*/ |