Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -2,8 +2,8 @@ class Array
def combsort!
gap = size
swaps = true
until gap <= 1 and swaps
gap = (gap / 1.25).to_int
while gap > 1 or swaps
gap = [1, (gap / 1.25).to_i].max
swaps = false
0.upto(size - gap - 1) do |i|
if self[i] > self[i+gap]