Top "Hashset" questions

A HashSet encapsulates operations that allow for the comparison of elements in collections.

HashSet vs LinkedHashSet

What is the difference between them? I know that A LinkedHashSet is an ordered version of HashSet that maintains a …

java hashset linkedhashset
Hashcode and Equals for Hashset

Please clarify my doubt in Hashset. Consider the following code, class Person { String name; Person(String n) { name=n; } public …

java equals hashcode hashset
Collection that allows only unique items in .NET?

Is there a collection in C# that will not let you add duplicate items to it? For example, with the …

c# set hashset
These Sets allow null. Why can't I add null elements?

I want to know why HashSet, LinkedHashSet and TreeSet implementation does not allow null elements? Whenever i try to run …

java null hashset
When should I use the HashSet<T> type?

I am exploring the HashSet<T> type, but I don't understand where it stands in collections. Can one …

c# .net data-structures hashset
Why doesn't java.util.HashSet have a get(Object o) method?

I've seen other questions about getting objects from Set's based on index value and I understand why that is not …

java hashset
Contains of HashSet<Integer> in Python

In Java we have HashSet<Integer>, I need similar structure in Python to use contains like below: A = [1, 2, 3] …

python contains hashset
What is the difference between HashSet<T> and List<T>?

Can you explain what is the difference between HashSet<T> and List<T> in .NET? Maybe …

.net list hashset difference
How does HashSet compare elements for equality?

I have a class that is IComparable: public class a : IComparable { public int Id { get; set; } public string Name { get; …

c# hashset
How to retrieve actual item from HashSet<T>?

I've read this question about why it is not possible, but haven't found a solution to the problem. I would …

c# .net hashset