Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -2,7 +2,7 @@ def merge_sort(m)
return m if m.length <= 1
middle = m.length / 2
left = m[0,middle]
left = m[0..middle - 1]
right = m[middle..-1]
left = merge_sort(left)

View file

@ -3,7 +3,7 @@ class Array
return self if length <= 1
comparitor ||= lambda {|a, b| a <=> b}
middle = length / 2
left = self[0, middle].mergesort(&comparitor)
left = self[0..middle - 1].mergesort(&comparitor)
right = self[middle..-1].mergesort(&comparitor)
merge(left, right, comparitor)
end