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 · 173 阅读 · 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 · 231 阅读 · 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 · 237 阅读 · 0 评论
分享