private static void Traverse(Node node, List<string> nodes, IEnumerable<Node> visited) { nodes.Add(node.Name); var children = node.Children(); var one = children.Except(visited).FirstOrDefault(); if(one != null) { visited = visited.Append(one); Traverse(one, nodes, visited); Traverse(node, nodes, visited); } }
public static List<Node> WhereAreTheExists(Node node) { return node.Children(); }