static void Main(string[] args) { List <string[]> orbitList = new List <string[]>(); using (Stream stream = File.OpenRead(@"..\..\..\Day06_Input.txt")) using (StreamReader reader = new StreamReader(stream)) { bool first = true; string line; while ((line = reader.ReadLine()) != null) { string[] s = line.Split(')'); if (first) { TreeNode <string> node = new TreeNode <string>(s[0]); tree = new TreeNodeList <string>(node); node.Children.Add(new TreeNode <string>(s[1])); first = false; } else { } } } }
public TreeNode(T Value, TreeNode <T> Parent) { this.Value = Value; this.Parent = Parent; Children = new TreeNodeList <T>(this); }
public TreeNode(T Value) { this.Value = Value; Parent = null; Children = new TreeNodeList <T>(this); }