Sorting algorithms/Comb sort: Difference between revisions
Content added Content deleted
(Added Algol 68) |
|||
Line 504: | Line 504: | ||
input size > 0 |
input size > 0 |
||
THEN # non-empty array, so must sort # |
THEN # non-empty array, so must sort # |
||
INT gap |
INT gap := input size; # initial gap is the whole array size # |
||
BOOL swapped := TRUE; |
BOOL swapped := TRUE; |
||
WHILE gap /= 1 OR NOT swapped DO |
WHILE gap /= 1 OR NOT swapped DO |