public object Dequeue() { object head = tailstack2.Pop(); Stack s = tailstack2.clone(); _stack1.Clear(); for (int i = 0; i < s.Top; i++) { _stack1.Push(s.Pop()); } _tail--; return(head); }
public void Enqueus(Object obj) { _stack1.Push(obj); Stack s = _stack1.clone(); tailstack2.Clear(); int j = s.Top; for (int i = 0; i < j; i++) { tailstack2.Push(s.Pop()); } _tail++; }