static void Main() { NodeInBinaryTree <int> topAction = new NodeInBinaryTree <int>(); MyBinaryTree <int> tree = new MyBinaryTree <int>(topAction); tree.Tz(); }
public int RecursivelyCreate(NodeInBinaryTree <T> newChild, T data = default(T)) { ConsoleKeyInfo item = Console.ReadKey(); if (item.KeyChar != '#') { newChild = new NodeInBinaryTree <T>(); Console.Write(newChild.charRef); RecursivelyCreate(newChild.LChild, default(T)); RecursivelyCreate(newChild.RChild, default(T)); } else { newChild = null; return(-1); } return(1); }
public int RecursivelyCreate(NodeInBinaryTree <T> newChild = null, T data = default(T), int length = 0) { string RefNodes = Console.ReadLine(); char[] Nodes = RefNodes.ToCharArray(); for (int position = 0; position < Nodes.Length; position++) { if (Nodes[position] != '#') { newChild = new NodeInBinaryTree <T>(); } else { newChild = null; } } return(1); }
public MyBinaryTree(NodeInBinaryTree <T> top = null, int length = 0) { _top = top; _length = length; }
public NodeInBinaryTree(T data = default(T), NodeInBinaryTree <T> lChild = null, NodeInBinaryTree <T> rChild = null) { _data = data; _lChild = lChild; _rChild = rChild; }