Should I use a C# Dictionary if I only need fast lookup of keys, and values are irrelevant?

You can use HashSet<T>.

The HashSet<T> class provides high-performance set operations. A set
is a collection that contains no duplicate elements, and whose
elements are in no particular order
.

Leave a Comment