Sorting algorithms/Comb sort: Difference between revisions

m
minor edits
(Add Common Lisp implementation)
m (minor edits)
Line 465:
(loop with input-size = (length input)
with gap = input-size
with swapped = t
while (or (> gap 1) swapped)
do (when (> gap 1)
(setf gap (floor gap *shrink*)))
(setf swapped nil)
(loop for lo from 0 below (- input-size gap)
for hi =from (+gap lobelow gap)input-size
do (when (> (aref input lo) (aref input hi))
(rotatef (aref input lo) (aref input hi))
(setf swapped t))))
while (or (> gap 1) swapped)
input)</lang>
finally (return input)))</lang>
 
=={{header|D}}==
68

edits