Do hashtables accept duplicate keys?
-
I know dictionaries don't accept duplicate keys, but hashtables are inherent within dictionaries. If the answer is yes, then what data structure could I use?
-
I know dictionaries don't accept duplicate keys, but hashtables are inherent within dictionaries. If the answer is yes, then what data structure could I use?
honeyman_can wrote:
what data structure could I use
One possibility is a hashtable whose values are
ArrayList
s list of values. When you try to add a duplicate key, append the key's value to the existing list. /raviMy new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com
-
I know dictionaries don't accept duplicate keys, but hashtables are inherent within dictionaries. If the answer is yes, then what data structure could I use?
Hashtables dont except duplicate keys, and im not sure there is a class that would allow you to store items in order and allow duplicated. U could try deriving a new class from the HashTable table and replacing the comparer property with a new one that will allow you to add duplicates.