Question: A deque is an ADT that generalizes a queue, allowing insertions and deletions at both ends. The C + + STL ( standard template library
A deque is an ADT that generalizes a queue, allowing insertions and deletions at both ends. The C STL standard template library has a list class which provides this capability, using a linked list implementation. It is described in Chapter but is not required reading at this time. For this assignment, you are to complete a simple implementation of an arraybased deque. The implementation uses the "circular array" scheme, as in the arraybased queue implementation we sketched in class. In the queue implementation, as elements are added or removed from the queue, the current queue contents "move" toward larger indices, so the front and back indexes into the array wrap around when they reach the "upper" end of the array. In an arraybased deque, the collection of queue elements can "move" either direction. So for the deque implementation, you need look after wrapping around at both ends of the array: at the "upper" end just as in the queue, and also at the "lower" end. The reserve function also requires more care in the deque case.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
