I am using a stl stacks and queues for storing a large collection of items. How is stack in standard template lib implemented internally? Is it in the form of linked list? or is there any maximum size given to it?
Both stacks and queues in C++ standard library are container adaptors. It means that they use specified container as the underlying means to store data. By default both of them use std::deque
but you can use e.g. vector with
std::stack<int,std::vector<int>> s;
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