Elad
Member
- Joined
- Feb 15, 2020
- Messages
- 20
- Programming Experience
- 1-3
Hey!
I wanted to find out, is it true to use an entire HashSet array?
Or the HashSet object is for certain real things, and not for any array!
However, if there is no logical limit whatsoever
I wanted to find out how I could anyway
HashSet does not need to replicate a repeatable array, I know that in classes inherit the IEquatable interface and change the Equals and GetHashCode functions
But an array of int variables (though inherited from the int32 structure) is a little more complicated by comparison, I've tried all sorts of built-in function techniques already from the HashSet object itself, but for some reason it doesn't help
More than that I can say that I built a class with a whole array property, inherited the IEquatable interface and changed the Equal and GetHashCode functions (to match the class content) but it didn't work!
The problem is more complex, when I create a one-dimensional whole array temporarily and I keep random numbers through the random class built into this array and then add it to HashSet, which I noticed (in Debuger) not only does it duplicate every other array to the same HashSet object Actually the number of times I really wanted to keep random numbers in the array!
This phenomenon reminds me, basically, of the random function built in C language that is not only used but also really adds a Time library and another function of span random, exclusive to the time library and the extra random function: random range without changing!
If anyone has an explanation, everything I mentioned above would love to hear!
I wanted to find out, is it true to use an entire HashSet array?
Or the HashSet object is for certain real things, and not for any array!
However, if there is no logical limit whatsoever
I wanted to find out how I could anyway
HashSet does not need to replicate a repeatable array, I know that in classes inherit the IEquatable interface and change the Equals and GetHashCode functions
But an array of int variables (though inherited from the int32 structure) is a little more complicated by comparison, I've tried all sorts of built-in function techniques already from the HashSet object itself, but for some reason it doesn't help
More than that I can say that I built a class with a whole array property, inherited the IEquatable interface and changed the Equal and GetHashCode functions (to match the class content) but it didn't work!
The problem is more complex, when I create a one-dimensional whole array temporarily and I keep random numbers through the random class built into this array and then add it to HashSet, which I noticed (in Debuger) not only does it duplicate every other array to the same HashSet object Actually the number of times I really wanted to keep random numbers in the array!
This phenomenon reminds me, basically, of the random function built in C language that is not only used but also really adds a Time library and another function of span random, exclusive to the time library and the extra random function: random range without changing!
If anyone has an explanation, everything I mentioned above would love to hear!