Sorting algorithms/Comb sort: Difference between revisions

m
Line 408:
from
until
gap = 1 and swapped = falseFalse
loop
from
i := Result.lower
swapped := falseFalse
until
i + gap > Result.count
Line 420:
Result [i] := Result [i + gap]
Result [i + gap] := swap
swapped := TRUETrue
end
i := i + 1
Line 440:
--- Is 'ar' sorted in ascending order?
require
ar_not_empty: ar.is_empty = FALSEFalse
local
i: INTEGER
do
Result := TRUETrue
from
i := ar.lower
Line 451:
loop
if ar [i] > ar [i + 1] then
RESULTResult := FALSEFalse
end
i := i + 1
Anonymous user