From: Olaf Klischat Date: 2005-07-18T21:00:54+09:00 Subject: Re: [SOLUTION] Sampling (#39) Stefan Mahlitz writes: > I really do > not need the value of any stored key. Right. > Why use a Hash? Efficiency. Array#include? runs in linear time (i.e. the running time is proportional to the size of the array because all elements have to be tested sequentially), while Hash#[] runs in constant time (i.e. the running time is independent of the size of the hash). So the array-based solution will scale very badly for large numbers.