GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing raw.githubusercontent.com — raw.githubusercontent.com

import java.util.ArrayList; import java.util.List; /* class MinStack { private Stack stack; private Stack minStack; public MinStack() { stack = new Stack<>(); minStack = new Stack<>(); } public void push(int x) { stack.push(x); if (minStack.size() == 0 || x <= minStack.peek()) minStack.push(x); } public void pop() { if (stack.size() > 0) { int curr = stack.pop(); if (minStack.size() > 0 && curr == minStack.peek()) minStack.pop(); } } public int top() { return stack.peek(); } public int getMin() { if (minStack.size() > 0) return minStack.peek(); else return stack.peek(); } } */ class MinStack { private Stack stack; private Stack minStack; public MinStack() { stack = new Stack<>(); minStack = new Stack<>(); } public void push(int x) { stack.push(x); if (minStack.size() == 0 || x <= minStack.peek()) minStack.push(x); else minStack.push(minStack.peek()); } public void pop() { stack.pop(); minStack.pop(); } public int top() { return stack.peek(); } public int getMin() { return minStack.peek(); } }
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.