Пример #1
0
 public void push(int in) {
   if (!isEmpty() && in > top()) totalRejected++;
   else super.push(in);
 }
Пример #2
0
 public int pop() {
   while (!isEmpty()) temp.push(super.pop());
   int ret = temp.pop();
   while (!temp.isEmpty()) push(temp.pop());
   return ret;
 }