doglin
October 16th, 2005, 10:06 PM
Hi :
Java's implementation of Hashtable provides the users with the public Object get(Object key)So if the user wants to retrieve the object value in the existing HashTable, they just need to provide the key, and the operation time is O(1).
However, I don't see the similar method in C#, it only has getEnumerator which will go through the entire table. and the timing is O(N)
I would like to know if there is something similar to the get(Object key) method I can use and has a time of O(1).
Many thanks,
Java's implementation of Hashtable provides the users with the public Object get(Object key)So if the user wants to retrieve the object value in the existing HashTable, they just need to provide the key, and the operation time is O(1).
However, I don't see the similar method in C#, it only has getEnumerator which will go through the entire table. and the timing is O(N)
I would like to know if there is something similar to the get(Object key) method I can use and has a time of O(1).
Many thanks,