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.

Tree Collection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Reg - 25 Sep 2007 20:31 GMT
Hello,

Has C# 2.0 Tree Collection or is it missing?
There is a ThreeNodeCollection for Win Forms but not as an data structure.
How have you implement TreeCollection just for data storage?

Cheers,
Peter Duniho - 25 Sep 2007 20:41 GMT
> Hello,
>
> Has C# 2.0 Tree Collection or is it missing?
> There is a ThreeNodeCollection for Win Forms but not as an data structure.
> How have you implement TreeCollection just for data storage?

There is no specific class for this, AFAIK.  The .NET Framework classes
all seem to implement their own variety of tree collections, with
features specific to their use (for example, the Control class has the
Controls property, tied to the Parent property of the contained instances).

It hasn't really come up much for me, but I find the List<> class is a
good general-purpose resizable collection class.  If you need some kind
of non-ordered indexed access to the collection, the Dictionary<> class
is helpful.  There are other collection classes that would be better in
other situations.

In fact, it's because of the wide variety of needs for a node's child
collection that various tree structures might have that I think may be
why there's no .NET base class for this sort of thing.  It's not
difficult to implement your own tree structure, and doing so allows you
to choose a child node collection class that best suits your needs.

Pete
Niels Ull - 28 Sep 2007 13:41 GMT
> Hello,
>
> Has C# 2.0 Tree Collection or is it missing?
> There is a ThreeNodeCollection for Win Forms but not as an data
> structure.
> How have you implement TreeCollection just for data storage?

The CLR doesn't contain that many collection classes.

You may want to look at free third party libraries, such as C5 (http://www.itu.dk/research/c5/)
or Power Collections (http://www.codeplex.com/PowerCollections).

> Cheers,

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.