A sample Queue interface definition

  • Sample Queue interface definition:

       interface MyQueueInterface<E>
       {
          boolean isEmpty(); // returns true is queue is empty
          boolean isFull();  // returns true is queue is full
    
          void enqueue(E e); // Insert elem e at the back of the queue
    
          E dequeue();       // Remove the elem at the front
                             // of the queue and return it
    
          E peek();          // Return the elem at the front
                             // without removing it
       }