Amazon interview question

Implement a stack data structure with O(1) push, pop and access to the largest element.

Interview Answer

Anonymous

Apr 2, 2014

I used two queues, one for the stack and one to hold largest elements.