public void deletenodebykey(int i)
        {
            NODE temp = header;

            if (temp != null && temp.data == i)
            {
                header = temp.NEXT;
                return;
            }
            while (temp != null && temp.data != i)
            {
                temp = temp.NEXT;
            }
            if (temp == null)
            {
                Console.WriteLine("NOT DELETING ITEM");
                return;
            }
            if (temp.NEXT != null)
            {
                temp.NEXT.PREV = temp.PREV;
            }
            if (temp.PREV != null)
            {
                temp.PREV.NEXT = temp.NEXT;
            }
        }
 public void TRAVERSE(NODE E)
 {
     E = header;
     while (E.NEXT != null)
     {
         Console.WriteLine(E.NEXT.data);
         E = E.NEXT;
     }
 }
        public void print()
        {
            NODE current = new NODE();

            current = header;


            while (current != null)
            {
                Console.WriteLine(current.data);
                current = current.NEXT;
            }
        }
        public void addatfirst(int e)
        {
            NODE addf = new NODE(e);

            addf.data = e;
            addf.NEXT = header;
            addf.PREV = null;
            if (header != null)
            {
                header.PREV = addf;
            }
            header = addf;
            //Console.WriteLine("{0}",e);
        }
 public DOUBLElinklist()
 {
     header = null;
     tail   = null;
 }
 public NODE(int d)
 {
     data = d;
     PREV = null;
     NEXT = null;
 }
 public NODE()
 {
     data = 0;
     PREV = null;
     NEXT = null;
 }