包含min函数的栈
时间限制:1秒
空间限制:32768K
热度指数:141061
本题知识点:
栈
算法知识视频讲解
题目描述
定义栈的数据结构,请在该类型中实现一个能够得到栈最小元素的min函数。
笔记
收藏
纠错
包含min函数的栈
返回全部题目
剑指Offer_编程题
列表加载中...
上一题
下一题
讨论
排行
保存并调试
求助
做题遇到困难?
查看通过的代码
参与大家的讨论
查看编程常见问题
保存并调试之后,这里将会显示运行结果
import java.util.Stack; public class Solution { public void push(int node) { } public void pop() { } public int top() { } public int min() { } }
class Solution { public: void push(int value) { } void pop() { } int top() { } int min() { } };
# -*- coding:utf-8 -*- class Solution: def push(self, node): # write code here def pop(self): # write code here def top(self): # write code here def min(self): # write code here
class Solution { public void push(int node) { } public void pop() { } public int top() { } public int min() { } }
function push(node) { // write code here } function pop() { // write code here } function top() { // write code here } function min() { // write code here } module.exports = { push : push, pop : pop, top : top, min : min };
function push(node) { // write code here } function pop() { // write code here } function top() { // write code here } function min() { // write code here }