Sorting algorithms/Comb sort: Difference between revisions
Content added Content deleted
m (→{{header|ALGOL 68}}: no point sorting a single-element array) |
(→{{header|ALGOL 68}}: fix psedo code translation) |
||
Line 506: | Line 506: | ||
INT gap := input size; # initial gap is the whole array size # |
INT gap := input size; # initial gap is the whole array size # |
||
BOOL swapped := TRUE; |
BOOL swapped := TRUE; |
||
WHILE gap /= 1 OR |
WHILE gap /= 1 OR swapped DO |
||
# update the gap value for a next comb # |
# update the gap value for a next comb # |
||
gap := ENTIER ( gap / 1.25 ); |
gap := ENTIER ( gap / 1.25 ); |