public void C3Q2() { var stack = new Stack(); stack.push(1); stack.push(2); stack.push(3); stack.push(4); var result = stack.min().data; Assert.AreEqual(result, 1); }
private void shiftStacks() { while (!newStack.isEmpty()) { oldStack.push(newStack.pop()); } }
new public void push(int item) { base.push(item); if (item <= min()) { stackForMin.push(item); } }