complexity
algorithm | Average | Worst case |
---|---|---|
space | O(k) | O(k) |
search | O(n) | O(n) |
insert | O(1) | O(1) |
delete | O(1) | O(1) |
- 常用方法 push pop top empty size swap emplace
implement
1 |
|
algorithm | Average | Worst case |
---|---|---|
space | O(k) | O(k) |
search | O(n) | O(n) |
insert | O(1) | O(1) |
delete | O(1) | O(1) |
1 | #include <iostream> |