Anonymous
public text v1 · immutablecomb_sort(list of t)
gap = list.count
temp as t
swapped = false
while gap > 1 or not swapped
swapped = false
if gap > 1 then
gap = floor(gap/1.3)
i = 0
while i + gap < list.count
if list(i) > list(i + gap)
temp = list(i) // swap
list(i) = list(i + gap)
list(i + gap) = temp
i += 1