Tony Johansson wrote:
Can somebody give me some example when this Stack<List<T> > s;
is used. I do know what this Stack<int> s; and this means List<int> l;
The type
Stack<List<whatever> >
would be used when you need a stack of lists of whatever. If you don't
need a stack of lists, don't use it.
Get yourself a book on data structures and algorithms. In it you might
come across a vector of lists or a hash map of stacks or something like
that. Such combinations are probably an order of magnitude (or more)
rarer than "regular" containers. The most frequent I've used was probably
vector<vector<something> >.
V