I require a tree / directed acyclic graph implementation something like this:
public class TreeNode {
private K key; // \'key\' for this node
There doesn't seem to be anything of the kind. I asked a similar question last week and ended up implementing my own tree. My implementation was very similar to what you're proposing:
public class TreeNode
{
private LinkedList> children = new LinkedList>();
public T value { get; set; }
public TreeNode(T value)
{
this.value = value;
}
public LinkedList> GetChildren()
{
return children;
}
}
You will have to add a link back to the parent(s).