/**
 * deque.h
 *
 * Jim Glenn 10/23/2002
 *
 * A deque (double-ended queue) is a structure that supports all the operations
 * a queue does and in addition supports additions at the front and
 * removals from the rear.
 */

#ifndef __DEQUE_H__
#define __DEQUE_H__

#include <iostream>

typedef int ItemType;

class Deque
{
 public:
  // pre: none
  // post: this new deque is empty
  Deque();

  // pre: none
  // post: this new deque contains the same items in the same order as the
  // one passed as a parameter
  Deque(const Deque& toCopy);

  // pre: none
  // post: this deque is destroyed
  ~Deque();

  // pre: none
  // post: returns the number of items in this deque
  int getSize() const;

  // pre: none
  // post: returns true iff this deque can't have more items added
  // [note: always false for our resizable array implementation]
  bool isFull() const;

  // pre: none
  // post: returns a new deque containing the same items in the same order
  // as this deque
  Deque clone() const;

  // pre: none
  // post: a string representation of this deque has been written to the
  // given stream
  void writeTo(ostream& os) const;

  // pre: none
  // post: this deque contains the same items in the same order as the
  // deque given as a parameter
  void copyFrom(const Deque& toCopy);

  // pre: this deque is not full
  // post: the item passed as a parameter has been added to the front of this
  // deque
  void addFront(const ItemType& toAdd);

  // pre: this deque is not full
  // post: the item passed as a parameter has been added to the back of this
  // deque
  void addBack(const ItemType& toAdd);

  // pre: this deque is not empty
  // post: the front element of this deque is removed and copied to the
  // parameter
  void removeFront(ItemType& removed);

  // pre: this deque is not empty
  // post: the front element of this deque is removed and copied to the
  // parameter
  void removeBack(ItemType& removed);

 private:

  // Your declarations go here
};
#endif

