// P.J. Waskiewicz 4/15/1998
// File: Tqueue.h
// Header file for queue ADT using a linked list
#ifndef _TQUEUE_H_
#define _TQUEUE_H_
template <class T>
class Queue {
public:
Queue();
// Precondition: None
// Postcondition: Creates an empty queue
void enqueue(T e);
// Precondition: None
// Postcondition: Element e is inserted into the queue at the beginning
T dequeue();
// Precondition: Queue is not empty
// Postcondition: Element at the top of the queue is returned and that
// element is removed from the queue
T front();
// Precondition: Queue is not empty
// Postcondition: Element at the beginning of the queue is returned
bool isEmpty();
// Precondition: None
// Postcondition: Will return true if queue is empty, false is not empty
private:
struct Node;
typedef Node * nodePtr;
struct Node {
T data;
nodePtr next;
};
nodePtr f;
nodePtr r;
};
#include "Tqueue.cc"
#endif