Exemple #1
0
        public static Node2 Tree2List(NodeTree tree, Node2 list)
        {
            if (tree == null)
            {
                return(list);
            }

            Node2 newNode = new Node2();

            newNode.value = tree.value;
            newNode.next  = null;
            list.next     = newNode;
            list          = newNode;
            list          = Tree2List(tree.L, list);
            list          = Tree2List(tree.R, list);

            return(list);
        }
Exemple #2
0
 public void Push(Node2 node)
 {
     _tail.next = node;
     _tail      = node;
     _size++;
 }
Exemple #3
0
 public QueueNode2()
 {
     _size = 0;
     _head = new Node2();
     _tail = _head;
 }