[algogeeks] Re: A bi-direction hashtable

2008-04-18 Thread shalinmangar
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

[algogeeks] Re: A bi-direction hashtable

2008-03-31 Thread Ridvan
>>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

[algogeeks] Re: A bi-direction hashtable

2008-03-30 Thread conundrum
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

[algogeeks] Re: A bi-direction hashtable

2008-03-27 Thread Debajit Adhikary
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 > > > > >

[algogeeks] Re: A bi-direction hashtable

2008-03-26 Thread phani bandaru
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