queue container?

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Wed Oct 26 03:04:28 PDT 2011


I don't understand the advantage of having a dynamic array of static arrays.
How is that gonna increase add/remove performance to the ends?

On Wed, Oct 26, 2011 at 1:28 PM, bearophile <bearophileHUGS at lycos.com> wrote:
> Gor Gyolchanyan:
>
>> The best implementation of queue IMO is using a doubly-linked list,
>
> On modern CPUs there is a better implementation:
> http://pages.cpsc.ucalgary.ca/~kremer/STL/1024x768/deque.html
> http://www.martinbroadhurst.com/articles/deque.html
>
> Essentially a dynamic (on the right) array of fixed-size arrays managed by pointer (in D you need to wrap the small arrays in a struct, I presume, because of the curious way D arrays are designed).
>
> Bye,
> bearophile
>


More information about the Digitalmars-d mailing list