chapter6-stack-and-queue-algorithm
栈和队列算法
[TOC]
1. 用栈实现队列
1 | class MyQueue: |
2. 用队列实现栈
1 | import queue |
3. 最小值栈
1 | class MinStack: |
4. 用栈实现括号匹配
1 | def isValid(): |
数组中元素与下一个比它大的元素之间的距离
1 | # 739. 每日温度 |
5. 循环数组中比当前元素大的下一个元素
1 | def nextGreaterElements(): |
basketball dance rap
[TOC]
1 | class MyQueue: |
1 | import queue |
1 | class MinStack: |
1 | def isValid(): |
1 | # 739. 每日温度 |
1 | def nextGreaterElements(): |