dmndxld

码不停题

2019年4月15日

c++stack类的用法

摘要: 官方解释: LIFO stack Stacks are a type of container adaptor, specifically designed to operate in a LIFO context (last-in first-out), where elements are in 阅读全文

posted @ 2019-04-15 21:02 imyourterminal 阅读(7358) 评论(0) 推荐(0) 编辑

栈应用:最小栈(第二题)

摘要: 题目: 设计一个支持 push,pop,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) -- 将元素 x 推入栈中。 pop() -- 删除栈顶的元素。 top() -- 获取栈顶元素。 getMin() -- 检索栈中的最小元素 分析: 1.每次压入两个元素,一个是元素本身,另 阅读全文

posted @ 2019-04-15 20:54 imyourterminal 阅读(270) 评论(0) 推荐(0) 编辑

导航