I have a class that only uses the keyCollection of a Dictionary<long, object>
, and I would like to pass to other class only the keys.
I know that the dictionary has a theorical O(1)
access-by-index (as a HashTable
) but if I convert the keyCollection to a List, the access would change to O(n)
.
How could I pass the keyCollection to my class maintaining the O(1)
access?
EDIT: I'm using .NET 2.0.
Thanks in advance.