473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Set difference algorithm for .NET generic collections?

Just before I have to implement my own.. I don't suppose the .NET
framework has an equivalent of the STL set_difference algorithm
yet...?

For e.g. If I have two containers: CompareSet={1,2,3} ToSet={2,3,4}
then diff(CompareSet,ToSet) = {4} and diff(ToSet,CompareSet) = {1}

Thanks,

Duncan

Sep 14 '07 #1
3 3201
On Sep 14, 7:52 am, Duncan Smith <DSmith1...@googlemail.comwrote:
Just before I have to implement my own.. I don't suppose the .NET
framework has an equivalent of the STL set_difference algorithm
yet...?

For e.g. If I have two containers: CompareSet={1,2,3} ToSet={2,3,4}
then diff(CompareSet,ToSet) = {4} and diff(ToSet,CompareSet) = {1}
The framework doesn't have the concept of a Set class. However, there
is on codeproject a set of classes (no pun intended <g>) at
http://www.codeproject.com/csharp/Types_Set.asp that you may be able
to modify to suit your needs.

Sep 14 '07 #2
On Sep 14, 2:07 pm, Doug Semler <dougsem...@gmail.comwrote:
On Sep 14, 7:52 am, Duncan Smith <DSmith1...@googlemail.comwrote:
Just before I have to implement my own.. I don't suppose the .NET
framework has an equivalent of the STL set_difference algorithm
yet...?
For e.g. If I have two containers: CompareSet={1,2,3} ToSet={2,3,4}
then diff(CompareSet,ToSet) = {4} and diff(ToSet,CompareSet) = {1}

The framework doesn't have the concept of a Set class. However, there
is on codeproject a set of classes (no pun intended <g>) athttp://www.codeproject.com/csharp/Types_Set.aspthat you may be able
to modify to suit your needs.
Thanks, a moment ago I just found out about Wintellect Power
Collections - looks like exactly what I was after.

Regards,

Duncan

Sep 14 '07 #3
It doesn't have a concept of a Set class, YET. .NET 3.5 (in beta now)
has a HashSet class which actually implements this logic for you, and will
be in the next release.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Doug Semler" <do********@gmail.comwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
On Sep 14, 7:52 am, Duncan Smith <DSmith1...@googlemail.comwrote:
>Just before I have to implement my own.. I don't suppose the .NET
framework has an equivalent of the STL set_difference algorithm
yet...?

For e.g. If I have two containers: CompareSet={1,2,3} ToSet={2,3,4}
then diff(CompareSet,ToSet) = {4} and diff(ToSet,CompareSet) = {1}

The framework doesn't have the concept of a Set class. However, there
is on codeproject a set of classes (no pun intended <g>) at
http://www.codeproject.com/csharp/Types_Set.asp that you may be able
to modify to suit your needs.

Sep 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jasper Kent | last post by:
I'm trying to do the equivalent of using typedefs with templates in C++ to avoid long instantiation names. I can do this okay: using BigDictionary = System.Collections.Generic.Dictionary<int,...
3
by: KH | last post by:
I can't seem to figure this one out... I've searched MSDN and Goog, and made my best guesses to no avail,, so help would be much appreciated! public ref class T sealed : public...
1
by: raylopez99 | last post by:
I seem to get name collision between the Generic collection SortedList and C++.NET Framework collection SortedList. How to resolve? Here are the libraries that seem to clash:...
4
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
We have a class that has a public property that is of type List<T>. FXCop generates a DoNotExposeGenericLists error, indicating "System.Collections.Generic.List<Tis a generic collection designed...
1
by: gihope | last post by:
Hi, I wonder if someone could help me. I'm trying to develop a search algorithm as I need an engine that can determine the shortest route between two locations based on the number of stops. I...
2
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... ...
5
by: Michi Henning | last post by:
I can pass a generic collection as ICollection<Tjust fine: static void flatCollection(ICollection<intc) {} // ... List<intl = new List<int>(); flatCollection(l); // Works fine Now I...
1
by: Duncan Smith | last post by:
Just before I have to implement my own.. I don't suppose the .NET framework has an equivalent of the STL set_difference algorithm yet...? For e.g. If I have two containers: CompareSet={1,2,3}...
2
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.