Exemplo n.º 1
0
 public void Add(SearchTreeNode <T> node)
 {
     if (GetChild(node) != null)
     {
         return;
     }
     add(node);
 }
Exemplo n.º 2
0
 private void add(SearchTreeNode <T> node)
 {
     if (node.Father != null)
     {
         node.Father.Remove(node);
     }
     node.Father = this;
     if (Children == null)
     {
         Children = new LinkedList <SearchTreeNode <T> >();
     }
     Children.AddLast(node);
 }
Exemplo n.º 3
0
 public SearchTreeNode <T> GetChild(SearchTreeNode <T> child)
 {
     if (Children != null)
     {
         foreach (var item in Children)
         {
             if (item.FullName == child.FullName)
             {
                 return(item);
             }
         }
     }
     return(null);
 }
Exemplo n.º 4
0
 public void Remove(SearchTreeNode <T> node)
 {
     if (Children != null)
     {
         foreach (var item in Children)
         {
             if (item.FullName == node.FullName)
             {
                 node.Father = null;
                 Children.Remove(item);
                 return;
             }
         }
     }
 }