Go to the previous, next section.
Deques are declared as an "abstract" class. They are currently implemented in two ways.
XPDeque
DLDeque
All possess the same capabilities. They differ only in constructors. XPDeque constructors optionally take a chunk size argument. DLDeque constructors take no argument.
Double-ended queues support both stack-like and queue-like capabilities:
Assume the declaration of a base element x
.
Deque d; or Deque d(int initial_capacity)
d.empty()
d.full()
d.length()
d.enq(x)
d.push(x)
x = d.deq()
d.front()
d.rear()
d.del_front()
d.del_rear()
d.clear()
Go to the previous, next section.