Top "Hashset" questions

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

Union vs Unionwith in HashSet

What the difference between HashSet.Union vs HashSet.Unionwith when i combine 2 hashsets. I am trying to combine like this: …

c# hashset
What is the main difference between Hashset, Treeset and LinkedHashset, Hashmap and how does it work in Java?

I just understand that LinkedHashSet does not allows duplicate elements when it is inserting. But, I dont understand how does …

java collections hashset linkedhashset
Build HashSet from a vector in Rust

I want to build a HashSet<u8> from a Vec<u8>. I'd like to do this …

vector rust hashset
Why have HashSet but not Set in C#?

Old question My understanding is that C# has in some sense HashSet and set types. I understand what HashSet is. …

c# set hashset
HashSet load factor

If I use a HashSet with a initial capacity of 10 and a load factor of 0.5 then every 5 elements added the …

java hashset
Why does HashSet implementation in Sun Java use HashMap as its backing?

Looking at the source of Java 6, HashSet<E> is actually implemented using HashMap<E,Object>, using …

java hashmap hashset
Efficient way to clone a HashSet<T>?

A few days ago, I answered an interesting question on SO about HashSet<T>. A possible solution involved …

.net performance clone hashset
Thread-safe HashSet with Guava Collections

Like the title says, i would like to get a thread-safe HashSet using Guava Collections. Are any available?

java collections hashset guava
Why adding null in HashSet does not throw Exception,but adding null in TreeSet throw Exception

Why adding null in HashSet does not throw Exception,but adding null in TreeSet throw Exception. Set<String> …

java hashset treeset
Why can't I preallocate a hashset<T>

Why can't I preallocate a hashset<T>? There are times when i might be adding a lot of …

c# hashset