Philippe Sigaud:
> > Yeah, particularly if having both stack and queue just costs one alias. I
> mean, it's a standard library. I know I can use built-in arrays (for
> example) as stacks and queues, but sometimes I just want to have a stack.

And in some situations it's better to have stacks and queues implemented with a 
deque (for example a dynamic array of pointers to short fixed-size arrays, 
where all arrays but the first and last one are full) instead of just a dynamic 
array.

Later some kind of cache-conscious B+-something tree can be useful ^_^ The 
implementation is not much harder than the Red-black trees, etc, but they can 
be better for small keys, because they use CPU cache lines better.

Bye,
bearophile

Reply via email to