Elad
Member
- Joined
- Feb 15, 2020
- Messages
- 20
- Programming Experience
- 1-3
to example:
static SortedSet<int[]> stl = new SortedSet<int[]>();
If I try to add a second member as an array of int I get an error that I should implement an IComparable interface:
(A screenshot appears of error below image 1)
My question is is it at all correct to work with SortedSet with an array of int? Or at all with arrays of primitive types?
And so it's supposed to work, so how am I supposed to implement this interface with a variable of type? Rather, am I supposed to build a particular object?
And anyway, I found another way which is to work with HashSet which works in the same logic of SortedSet which prevents duplication but has a problem with it
When I have over 500,000 organs it does not really check if there is an added organ exists in the array,(A screenshot appears of below image 2)
Which means it keeps duplicates
How, after all, do I avoid duplications when the number of organs is very large?
static SortedSet<int[]> stl = new SortedSet<int[]>();
If I try to add a second member as an array of int I get an error that I should implement an IComparable interface:
(A screenshot appears of error below image 1)
My question is is it at all correct to work with SortedSet with an array of int? Or at all with arrays of primitive types?
And so it's supposed to work, so how am I supposed to implement this interface with a variable of type? Rather, am I supposed to build a particular object?
And anyway, I found another way which is to work with HashSet which works in the same logic of SortedSet which prevents duplication but has a problem with it
When I have over 500,000 organs it does not really check if there is an added organ exists in the array,(A screenshot appears of below image 2)
Which means it keeps duplicates
How, after all, do I avoid duplications when the number of organs is very large?