Пример #1
0
        private int SizeRecursive(FCNSNode <T> node)
        {
            if (node == null)
            {
                return(0);
            }

            return(1 + SizeRecursive(node.FirstChild) + SizeRecursive(node.NextSibling));
        }
Пример #2
0
        private void PreOrderTravers(FCNSNode <T> node)
        {
            if (node == null)
            {
                return;
            }

            Console.Write(node.Value + " ");
            PreOrderTravers(node.FirstChild);
            PreOrderTravers(node.NextSibling);
        }
Пример #3
0
 public FCNSNode <T> AddChild(T value)
 {
     if (FirstChild == null)
     {
         FirstChild = new FCNSNode <T>(value);
         return(FirstChild);
     }
     else
     {
         return(FirstChild.AddSibling(value));
     }
 }
Пример #4
0
 public FCNSNode(T value)
 {
     Value       = value;
     FirstChild  = null;
     NextSibling = null;
 }
Пример #5
0
 public FCNSTree(T value)
 {
     Root = new FCNSNode <T>(value);
 }