Anonymous user
Sorting algorithms/Comb sort: Difference between revisions
m
→{{header|Eiffel}}
Line 408:
from
until
gap = 1 and swapped =
loop
from
i := Result.lower
swapped :=
until
i + gap > Result.count
Line 420:
Result [i] := Result [i + gap]
Result [i + gap] := swap
swapped :=
end
i := i + 1
Line 440:
--- Is 'ar' sorted in ascending order?
require
ar_not_empty: ar.is_empty =
local
i: INTEGER
do
Result :=
from
i := ar.lower
Line 451:
loop
if ar [i] > ar [i + 1] then
end
i := i + 1
|