Re: Dequeue element overhead



Actually, I disagree.

I also see no reason for a Queue to require a contiguous memory space to
store many elements.  Ever heard of linked lists?

If it really is similar to arrays, then the act of adding to the
beginning of a Queue must be significantly less efficient than adding
at the end.  Anyone got a benchmark to test this?

During the last few months people have been posting about how
surprisingly efficient and fast passing data via Queues is.  I
would say that the overhead required to queue or dequeue is negligible.

Of course, if you're queuing a 1MB array every millisecond or so it'll
be a different story, but for "normal" use, it's easily fast enough.

Shane.
Message Edited by shoneill on 09-30-2005 12:28 AM
.



Relevant Pages

  • Re: searching for the largest array
    ... > which you can do in constant time, ... > Your main data structures are a set of maximal ... > ARRAYS and QUEUE. ... QUEUE will actually hold records ...
    (comp.lang.lisp)
  • Re: searching for the largest array
    ... which you can do in constant time, ... Your main data structures are a set of maximal ... ARRAYS and QUEUE. ...
    (comp.lang.lisp)
  • Re: Merging of priority queue
    ... William Stacey [C# MVP] ... Why not just copy the arrays to a new array or ... | Then the queue itself has to sort it, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Merging of priority queue
    ... Why not just copy the arrays to a new array or ... William Stacey [C# MVP] ...
    (microsoft.public.dotnet.languages.csharp)