Completed prob2 solution

Q: Adeque is a data structure consisting of a list of items, on which
the following operations are possible :
Push(X,D ): Insert item X on the front end of deque D.
Pop(D) : Remove the front item from deque D and return it.
Inject(X,D) : Insert item X on the rear end of deque D
Eject(D) : Remove the rear item from deque D and return it.

Write routines to support deque that take O(1) time per operation