Set operation in .NET C #

I'm working on something related to rudeness. The project uses many operations and manipulations. I use string operations as a stop measure for the install operation. It worked fine until we needed to process some unholy amount of data (500,000 records with approximately 40 columns each) through the algorithm.

I know that there is no established data structure in .net 2.0 (2.0 was the last when I started the project). I want to know if there is any library that offers a quick installation operation in .net C #, or if 3.5 added a built-in data structure.

Thanks.

+4
source share
9 answers

.NET 3.5 already has its own set data type: HashSet . You can also watch HashSet and LINQ set up operators for operations.

In .NET 1.0, a third party data type was installed: Iesi.Collections , which was extended using the .NET 2.0 generic extensions with Iesi.Collections.Generic .

You might want to try and look at everything to see which one is most useful to you. :)

+10
source

LINQ supports some specific operations. See the LINQ 101 page .
There is also a HashSet class (.NET 3.5)


Here are the Microsoft recommendations for performing network operations in .NET:

HashSet and LINQ Set Operations

List of defined operations supported by the HasSet class:

HashSet Collection Type

+5
source

Update: this is for .Net 2.0. For .Net 3.5, see Messages from aku, Jon ..

This is a good reference for efficiently representing sets in .Net .

+2
source

Perhaps it's worth taking a look at C5 , which is a common collection library for .NET that includes collections.

Please note that I didn’t dig into this very much, but it seems to be a pretty fantastic collection library.

+2
source

Try HashSet in .NET 3.5.

This page from a member of the .NET BCL team contains some useful information about HashSet intentions.

+1
source

I abused the Dictionary class in .NET 2.0 as a set:

private object dummy = "ok"; public void Add(object el) { dict[el] = dummy; } public bool Contains(object el) { return dict.ContainsKey(el); } 
+1
source

You can use Linq for objects in C # 3.0.

0
source

Have you ever thought about singing F #? This seems to work for a functional programming language.

0
source

You should take a look at the C5 Generic Collection Library . This library is a systematic approach for fixing holes in the .NET class library by providing missing structures as well as replacing existing ones with a set of well-designed interfaces and common classes.

Among others, there is a HashSet<T> - a general class of Set based on linear hashing.

0
source

Source: https://habr.com/ru/post/1277003/


All Articles