Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

Set difference algorithm for .NET generic collections?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Duncan Smith - 14 Sep 2007 12:52 GMT
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
Doug Semler - 14 Sep 2007 14:07 GMT
> 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.
Duncan Smith - 14 Sep 2007 14:24 GMT
> > Just before I have to implement my own..  I don't suppose the .NET
> > framework has an equivalent of the STL set_difference algorithm
[quoted text clipped - 6 lines]
> 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
Nicholas Paldino [.NET/C# MVP] - 14 Sep 2007 15:53 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>> Just before I have to implement my own..  I don't suppose the .NET
>> framework has an equivalent of the STL set_difference algorithm
[quoted text clipped - 7 lines]
> http://www.codeproject.com/csharp/Types_Set.asp that you may be able
> to modify to suit your needs.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.