Ejemplo n.º 1
0
        public void AddtoStart(int d)
        {
            DoublyNode new_node = new DoublyNode(d);

            if (start == null)
            {
                start = new_node;
                end   = start;
            }
            else
            {
                start.prev    = new_node;
                new_node.next = start;
                start         = new_node;
            }
            size++;
        }
Ejemplo n.º 2
0
        public void AddtoEnd(int d)
        {
            DoublyNode new_node = new DoublyNode(d);

            if (start == null)
            {
                start = new_node;
                end   = start;
            }
            else
            {
                new_node.prev = end;
                end.next      = new_node;
                end           = new_node;
            }
            size++;
        }