Hello --

On Mon, 15 Apr 2002, Alex Liebowitz wrote:

> Is there any way to specify a value and hash, and get the key corresponding
> to that value (in O(1) time, preferably)?

Not sure about performance, but try Hash#index:

  h = { 1,2,3,4 }
  h.index(2)      # => 1



David

-- 
David Alan Black
home: dblack / candle.superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav