标签:support view opera only one push you operation elements
Design a max stack that supports push, pop, top, peekMax and popMax.
Example 1:
MaxStack stack = new MaxStack(); stack.push(5); stack.push(1); stack.push(5); stack.top(); -> 5 stack.popMax(); -> 5 stack.top(); -> 1 stack.peekMax(); -> 5 stack.pop(); -> 1 stack.top(); -> 5
Note:
s
标签:support view opera only one push you operation elements
原文地址:http://www.cnblogs.com/grandyang/p/7823424.html