> I read somewhere that stacks are best implemented as deques. Don't ask me > why now, > but I think they are slightly cheaper. (I'm sure Andre would have a view > about this.)
Some googling gives me: The C++ Standard, in section 23.1.1, offers some advice on which containers to prefer. It says: "vector is the type of sequence that should be used by default... deque is the data structure of choice when most insertions and deletions take place at the beginning or at the end of the sequence." "Most C++ developers still tend to think in terms of arrays when they use sequence containers, and std::vector is the simplest container that fulfills this need. Especially for amateurs like me who don't know what a deque is, I would prefer to use vector... keep it simple and stupid ;). To conclude, I don't see any reason to not use a vector. I think you also changed some vectors into lists because it needn't be a vector. I think I'd prefer a vector there too. Vincent