![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
stack
文章平均质量分 72
伊萨卡钢琴家
这个作者很懒,什么都没留下…
展开
-
Leetcode Stack总结
20. Valid Parentheses https://leetcode.com/problems/valid-parentheses/现在看到括号就想用stack判断了,因为它是个后入先判断的节奏42. Trapping Rain Water 这道题我更想把它称作Dynamic Programming的题https://leetcode.com/problems/trap原创 2016-01-25 06:54:43 · 570 阅读 · 0 评论 -
Leetcode 71. Simplify Path
Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corner cases.Corner Cases:Did原创 2016-01-25 11:25:10 · 238 阅读 · 0 评论 -
Leetcode 316. Remove Duplicate Letters
Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order a原创 2016-01-25 11:56:58 · 369 阅读 · 0 评论 -
Leetcode 155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get原创 2016-01-25 12:03:51 · 262 阅读 · 0 评论 -
Leetcode 225. 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 whet原创 2016-01-25 12:16:31 · 209 阅读 · 0 评论 -
Leetcode 150. Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples:import java.u原创 2016-01-25 12:24:14 · 232 阅读 · 0 评论 -
Leetcode 316. Remove Duplicate Letters
Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order a原创 2016-01-27 09:22:05 · 423 阅读 · 0 评论