Exemplo n.º 1
0
        static void Main()
        {
            NodeInBinaryTree <int> topAction = new NodeInBinaryTree <int>();
            MyBinaryTree <int>     tree      = new MyBinaryTree <int>(topAction);

            tree.Tz();
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public MyBinaryTree(NodeInBinaryTree <T> top = null, int length = 0)
 {
     _top    = top;
     _length = length;
 }
Exemplo n.º 5
0
 public NodeInBinaryTree(T data = default(T), NodeInBinaryTree <T> lChild = null, NodeInBinaryTree <T> rChild = null)
 {
     _data   = data;
     _lChild = lChild;
     _rChild = rChild;
 }