这道题js的做法还是蛮简单的
应为js的栈和队列其实都是利用数组建立的
var stack = [];
function push(node)
{
stack.push(node);
// write code here
}
function pop()
{
if(stack.length){
stack.pop();
}
// write code here
}
function top()
{
return stack[0];
// write code here
}
function min()
{
return Math.min.apply(null,stack)
// write code here
}