What is the lookup time complexity of HashSet(IEqualityComparer)?
A HashSet works via hashing (via IEqualityComparer.GetHashCode) the objects you insert and tosses the objects into buckets per the hash. The buckets themselves are stored in an array, hence the O(1) part. For example (this is not necessarily exactly how the C# implementation works, it just gives a flavor) it takes the first character of … Read more