public static void inc(int i, int v) { block temp = last; for (int j = 0; j < i; j++) { temp.data += v; temp = temp.prev; } }
public static void pop() { if (first == null && last == null) { Console.WriteLine("EMPTY"); } else { first = first.next; first.prev = null; Lin_List_Stack.returntop(); } }
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; } }