摘要: 题目描述: 设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) —— 将元素 x 推入栈中。pop() —— 删除栈顶的元素。top() —— 获取栈顶元素。getMin() —— 检索栈中的最小元素。 示例: 输入:["MinStack","pu 阅读全文
posted @ 2020-12-12 12:21 Geeksongs 阅读(186) 评论(0) 推荐(0) 编辑

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.