home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_09 / 8n09121a < prev    next >
Text File  |  1990-07-09  |  619b  |  30 lines

  1.  
  2.     class Queue {    // queue of integers
  3.     public:
  4.         // initialize the queue to empty
  5.         Queue();
  6.         
  7.         // returns TRUE if the queue is empty, else FALSE
  8.         Truth isempty();
  9.     
  10.         // returns TRUE if queue is full, else FALSE
  11.         True isfull();
  12.         
  13.         // deletes and returns value at head of queue
  14.         // precondition:  !isempty()
  15.         int gethead();
  16.         
  17.         // make x the new head of the queue
  18.         void puthead( int x);
  19.         
  20.         // delete and return the last element in the queue
  21.         // precondition:  !isempty()
  22.         int gettail();
  23.         
  24.         // make x the last element in the queue
  25.         void puttail( int x);
  26.     private:
  27.         ...
  28.     };
  29.  
  30.