![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
栈
_xiaoyuer
世界一定有光
展开
-
LeetCode - 225 - Implement Stack using Queues(队列实现栈)
苦苦思索怎么用两个队列实现栈,越想越复杂,越想越懵逼,然后发现解决区的大神一个队列就搞定了【幽灵幽灵飘】 可能是模拟队列是用两个栈实现的,然后导致潜意识觉得实现栈也需要用两个队列吧。思维固化orzzzzz class MyStack { public: queue q; /** Push element x onto stack. */ void push(原创 2017-07-01 11:04:12 · 281 阅读 · 0 评论 -
LeetCode - 20 - Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all va原创 2017-07-19 09:45:38 · 144 阅读 · 0 评论