Esempio n. 1
0
        public static void inc(int i, int v)
        {
            block temp = last;

            for (int j = 0; j < i; j++)
            {
                temp.data += v;
                temp       = temp.prev;
            }
        }
Esempio n. 2
0
 public static void pop()
 {
     if (first == null && last == null)
     {
         Console.WriteLine("EMPTY");
     }
     else
     {
         first      = first.next;
         first.prev = null;
         Lin_List_Stack.returntop();
     }
 }
Esempio n. 3
0
        public static void push(int x)
        {
            if (first == null & last == null)
            {
                block b = new block();
                b.data = x;
                b.next = null;
                b.prev = null;
                first  = b;
                last   = b;
            }

            else
            {
                block b = new block();
                b.data     = x;
                first.prev = b;
                b.next     = first;
                first      = b;
            }
        }