Like the title asks Is there any time or space difference between a std::vector used as a stack and a std::stack ?
A std::stack
wraps another container. If the backing container of your stack is a std::vector
, then no, there is no difference.
The default backing container is however a std::deque
, which can have different storage and timing behaviour
See std::stack for details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With