All Questions
18
questions
4
votes
2
answers
4k
views
Set<T> data structure in C#
The following data structure is meant for manipulating algebraic/mathematical sets.
I want Set<T> to be compatible and interchangeable with any similar data ...
4
votes
2
answers
185
views
Finding which items have at least one common value with other items
I have the following collection :
...
4
votes
1
answer
101
views
Immutable Keyed Set
Description
An immutable keyed set is a readonly collection of elements without
duplicates or null values having each of the elements linked to
exactly one key.
Example
This simple example ...
1
vote
1
answer
314
views
Grow-only set (CRDT)
I made up a quick and dirty implementation of the G-Set in C#. I was hoping for some feedback on my approach. I'm not totally happy with having the payload public but I can't see that I'm gaining ...
11
votes
1
answer
9k
views
Concurrent HashSet
I've recently been using HashSet and locking on each method, I found this to not only be a lot of work (was using it in a lot of places) but I started to see inconsistency in my code.
I later decided ...
2
votes
1
answer
649
views
Dictionary with ISet key as a collection of names
I'm writing a command-line utility and I need to find commands (and parameters) by name. The name can either be a full name like save or a shortcut ...
2
votes
2
answers
194
views
Find combination of sets which sum up to a specified result
Example input :
A) 1, 2
B) 2, 8
C) 7, 8
Required Result : 8, 10
The output from the program with this input should be A + C.
Few notes :
We can only combine 2 sets.
There must ...
2
votes
1
answer
311
views
IEnumerable and Predicate sets in .NET
GitHub Repository
Previously: Countable and uncountable sets in .NET (clean version).
Thesis
There is a full featured support of countable sets in .NET: ...
2
votes
0
answers
102
views
Countable and uncountable sets in .NET (set operators, demo)
Up-to-date version: IEnumerable and Predicate Sets in .NET (Complete, Explained).
Previously: Countable and uncountable sets in .NET (clean version).
Disclaimer: Please do not interpret my attempts ...
8
votes
7
answers
3k
views
An ordered set in C#
I need a generic data structure that ensures that its elements are unique. C# has HashSet<T>, great!
As it turns out, the elements have to stay in the order ...
2
votes
1
answer
334
views
Countable and uncountable sets in .NET (clean version)
Sorry, it used to be some retired garbage in Countable and uncountable sets. Now and here it is clean.
P.S. I would not like to say that this stuff is about to replace functional programming :) No, ...
3
votes
2
answers
622
views
Countable and uncountable sets in .NET (IEnumerable and Predicate)
There is a full featured support of countable sets in .NET: IEnumerable<T>. What about uncountable sets; sets defined by predicate? How can they be ...
5
votes
1
answer
2k
views
VERY simple C# Set implementation
This is not meant to solve any insane real world problems. I just want to make sure my Set logic is right and the code looks okay. It feels weird implementing it with a ...
3
votes
1
answer
1k
views
Calculate pairs in a Set ("Sherlock and Pairs" HackerRank challenge)
I have started reading clean code and want to improve my coding practices. Here is my attempt at solving an online puzzle. Please review the code and let me know how could I have written it better in ...
7
votes
4
answers
3k
views
Faster Way of Comparing Generic Sets
The following extension method is the limiting factor in the performance of an application I am developing, according to Visual Studio 2012 Performance Analysis profiler.
Is there a faster way to ...