private int SizeRecursive(FCNSNode <T> node) { if (node == null) { return(0); } return(1 + SizeRecursive(node.FirstChild) + SizeRecursive(node.NextSibling)); }
private void PreOrderTravers(FCNSNode <T> node) { if (node == null) { return; } Console.Write(node.Value + " "); PreOrderTravers(node.FirstChild); PreOrderTravers(node.NextSibling); }
public FCNSNode <T> AddChild(T value) { if (FirstChild == null) { FirstChild = new FCNSNode <T>(value); return(FirstChild); } else { return(FirstChild.AddSibling(value)); } }
public FCNSNode(T value) { Value = value; FirstChild = null; NextSibling = null; }
public FCNSTree(T value) { Root = new FCNSNode <T>(value); }