Exemplo n.º 1
0
 private bool ParentExist(BiDirectionalVertex <T> root, BiDirectionalVertex <T> searchVertex)
 {
     if (root.IsVisited)
     {
         return(false);
     }
     root.IsVisited = true;
     return(root.Equals((object)searchVertex) || root.Parents.Any <BiDirectionalVertex <T> >((Func <BiDirectionalVertex <T>, bool>)(parent => this.ParentExist(parent, searchVertex))));
 }
Exemplo n.º 2
0
 private bool ChildExist(BiDirectionalVertex <T> root, BiDirectionalVertex <T> searchVertex)
 {
     if (root.IsVisited)
     {
         return(false);
     }
     root.IsVisited = true;
     return(root.Equals((object)searchVertex) || root.Childs.Any <BiDirectionalVertex <T> >((Func <BiDirectionalVertex <T>, bool>)(child => this.ChildExist(child, searchVertex))));
 }