1. Adapted from Sahni, Chapter 10, Question 7 (a)-(c)

Consider a double-ended queue (deque) of characters. A deque differs from a standard queue in that it allows objects to be added and deleted from both ends of the queue. Contrast this to a standard queue, where objects can only be added to the end of the queue and removed from the front.

  1. What operations would you expect of a deque ADT?
  2. What are the pre- and post-conditions of these operations?
  3. Fully specify the behaviour of a deque ADT by specifying the complete behaviour of each operation of the deque ADT.
  4. Write a non-cyclic block implementation of the deque ADT you specified above.