public void ShowTree(CodeTree tree) { string thisNode = ""; thisNode += tree.Value; thisNode += ": "; int childsNumber = tree.NumberOfChilds; for (int i = 0; i < childsNumber; i++) { thisNode += tree.GetChildValue(i + 1); thisNode += " "; ShowTree(tree.GetChild(i + 1)); } Console.WriteLine(thisNode); }
//Dodanie dziecka do węzła - dodaje na sam koniec listy dzieci public void AddChild(CodeTree child, ref CodeTree parent) { child.Parent = parent; Childs.Add(child); }