![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode stack
proudmore
这个作者很懒,什么都没留下…
展开
-
Leetcode Largest rectangle in histogram
Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.算法: 1. if height[i]>=stack.peek(), push 2.原创 2015-03-28 01:45:25 · 136 阅读 · 0 评论 -
Leetcode Implement stack using queues
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. empty() -- Return whethe原创 2015-06-19 07:50:52 · 180 阅读 · 0 评论 -
Leetcode Simplify path
Given an absolute path for a file (Unix-style), simplify it.For example, path = “/home/”, => “/home” path = “/a/./b/../../c/”, => “/c”corner case: "/a//b", "" 开始把/.. 理解错了…. /a/b/.. = /a, /../../原创 2015-07-06 08:24:48 · 189 阅读 · 0 评论