DEQueue data structure

Douglas S. J. De Couto decouto at lcs.mit.edu
Thu Jun 26 15:23:06 EDT 2003


I just added a new double ended queue data structure to click.  It's
called DEQueue, and it's based on the Vector code.  The advantage over
Vector is that DEQueue lets you push/pop on the front in constant
time, as well as push/pop on the back like Vector.  The main
disadvantage is that the iterators are more complex (because they have
to handle wraparound in the underlying array), and perhaps some
operations have an extra bit of book-keeping (two indices [head, tail]
in addition to the size value).  I have done some testing and it seems
to work for me so far...

d

-- 
Douglas S. J. De Couto    decouto at lcs.mit.edu




More information about the click mailing list