Week 9: Exercises

1. Double-Ended Queue

Design and implement a C# class Deque<T> that implements a deque (i.e. a double-ended queue) using a doubly-linked list. Your class should include the following:

2. Counting Dequeue

Also write a subclass CountingDeque<T> that keeps track of the total number of values that have ever been pushed to a deque. The subclass should include a read-only property totalPushes that returns this value.