Collection type to represent hierarchical structure in .Net 3.5

I have experimented with various methods for representing hierarchical structures in memory that would allow transversally both up and down in a simple and efficient way to discover ancestor-descendant relationships. Does anyone have any suggestions or examples of options that I have? Is there a collection type in .Net 3.5 that helps here?

0
collections .net-3.5 hierarchy


source to share


5 answers


So you want a Tree ? FGI



+1


source to share


How do I create my own node that looks something like this:

  class Node<T> {
    public T Item;
    public LinkedList<T> Children;
  }

      



Then apply node recursively as needed

0


source to share


System.Web.UI.IHierarchicalEnumerable

- an interesting template.

0


source to share


I'm afraid there is nothing there by default. Make your own.

0


source to share


I am using LINQ to traverse hierarchical structures that I have downloaded from XML Web Services, but I am sure LINQ will share well to traverse your collection of trees.

-Mike

PS. I mention this because LINQ is just fun.

0


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics