Linear probing as a hash collision strategy in Ruby and Java