Can someone help me justify having both of these? They both implement mergesort via the same techniques. One just uses easier to read code. For IronRuby, if I substitute mergesort_hongli’s Bench block with mergesort's Bench block, I get numbers that are almost identical (within .2s of each other). I’m guessing I’m missing something, so I’d like to know.
Thanks,
JD
…there is no try
Can someone help me justify having both of these? They both implement mergesort via the same techniques. One just uses easier to read code. For IronRuby, if I substitute mergesort_hongli’s Bench block with mergesort's Bench block, I get numbers that are almost identical (within .2s of each other). I’m guessing I’m missing something, so I’d like to know.
fname = File.dirname(__FILE__) + "/random.input"array = File.read(fname).split(/\n/).map!{|m| m.to_i }
Bench.run [1] do |n|array.merge_sortend