September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,16 @@
(defparameter *shrink* 1.3)
(defun comb-sort (input)
(loop with input-size = (length input)
with gap = input-size
with swapped
do (when (> gap 1)
(setf gap (floor gap *shrink*)))
(setf swapped nil)
(loop for lo from 0
for hi from gap below input-size
when (> (aref input lo) (aref input hi))
do (rotatef (aref input lo) (aref input hi))
(setf swapped t))
while (or (> gap 1) swapped)
finally (return input)))