我在 O(1) 时间内看到了有关使用 findmin 设计堆栈的问题的答案:
https://stackoverflow.com/a/3435998/2653179
如果请求相同怎么办:
Devise a stack-like data structure that does push, pop and min (or max) operations
in O(1) time. There are no space constraints.
但是 deletemin 也应该在 O(1) 中?可能吗?