mirror of
https://github.com/ShusenTang/LeetCode.git
synced 2024-09-02 14:20:01 +00:00
add monotonic_stack_queue url
This commit is contained in:
parent
e19bb7d5f6
commit
69b3f6019e
@ -15,7 +15,7 @@
|
||||
|
||||
至少需要两次遍历,所以时间复杂度为O(n);至少开辟一个额外的数组,所以空间复杂度O(n)。
|
||||
|
||||
## 思路二、栈
|
||||
## 思路二、单调栈
|
||||
|
||||
这题的tag是stack,所以我们考虑用栈来解决。
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
|
||||
这样我们只需要遍历一次,时间复杂度还是O(n);空间复杂度O(n)
|
||||
|
||||
关于单调栈可以参考[我的总结](../algorithm/array/monotonic_stack_queue.md)。
|
||||
|
||||
## 思路三、双指针
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user