Right, there is no way to get the hash-value of the key given only the
value. So it is not possible to implement Find2(v) with only one
Hashtable.
Just as a reference, the same two-hashmap approach is used by the
BiMap class in google-collections library.
http://google-collections.googlecode.com
>>Given value you can easily find the key using hash function it self
Maybe you mean if you have the hash value of the key?
But it is different than value which is stored in the hashtable?
On Mar 27, 9:39 am, "phani bandaru" <[EMAIL PROTECTED]> wrote:
> Given value you can easily find the key u
I agree with Phani.. however there the hash function that is used must
have some mathematical properties..
lets assume u have a hash function H such that
Key > H -> Value ..
then
Value -> H' --> Key
where H' is the inverse function of H. Hence your original hash
function must be
Could you clarify this please?
On Wed, Mar 26, 2008 at 11:39 PM, phani bandaru <[EMAIL PROTECTED]>
wrote:
> Given value you can easily find the key using hash function it self.-
> Find2(v)
> If we just have one hash table, that is enough to do the first two
> operations. Insert & Find1
>
>
>
>
>
Given value you can easily find the key using hash function it self.-
Find2(v)
If we just have one hash table, that is enough to do the first two
operations. Insert & Find1
On 3/27/08, Sticker <[EMAIL PROTECTED]> wrote:
>
>
> I was interviewed a question about implementing a bi-direction
> has