You don't need a data special structure for the tree. Having such data type in a standard library would be absolutely redundant, because a tree is just a list of some elements which has a "children" member of the same type.
Here is the simplest example:
using Tree = System.Collections.Generic.List<TreeNode>;
class TreeNodeData { }
class TreeNode {
public TreeNodeData Data { get; set; }
public Tree Children { get { return fChildren; } }
public void AddChild(TreeNode child) {
if (fChildren == null)
fChildren = new Tree();
fChildren.Add(child);
}
Tree fChildren;
}
MyTree tree = new Tree();
tree.Data =
tree.AddChild(new Tree());
Got an idea?
—SA