public virtual Node Pop()
 {
     if (top == null)
         return null;
     Node n = top;
     top = top.next;
     return n;
 }
 public Node dequeue()
 {
     if (first == null)
         return null;
     Node n = first;
     first = first.next;
     if (first == null)
         last = null;
     return n;
 }
 public void enqueue(int i)
 {
     Node n = new Node(i);
     if(last == null)
     {
         last = n;
         first = n;
         return;
     }
     last.next = n;
     last = last.next;
 }
 public void Push(int n)
 {
     Node node = new Node(n);
     Stack last;
     if (stacks.Count == 0)
     {
         last = new Stack();
         stacks.Add(last);
     }
     else last = stacks.ElementAt(stacks.Count - 1);
     if (last.GetSize() == stackLimit)
     {
         last = new Stack();
         stacks.Add(last);
     }
     last.Push(n);
     //PrintStacks();
 }
 public virtual void Push(Node n)
 {
     n.next = top;
     top = n;
 }
 public virtual void Push(int i)
 {
     Node n = new Node(i);
     n.next = top;
     top = n;
 }
 public override void Push(Node n)
 {
     if (mins.top == null || mins.top.data >= n.data)
         mins.Push(new Node(n.data));
     base.Push(n);
 }