Is there a data structure which works like a two-way hashmap?
Specifically, a hashmap can map keys to values, and I would like it also be able to map values to keys, assuming the mapping from keys to values are bijective, so that the mapping has a reverse mapping.
I can have two data structures for the mapping and its reverse mapping. Is it a good idea?
I wonder if there is a single data structures for both?
In Java, is there a collection for that purpose?
Thanks.