Header File for Queue ADT - Pointer Based Implementation


#ifndef QUEUEPTR_H
#define QUEUEPTR_H

// ********************************************************
// Header file Queueptr.h for the ADT Queue.
// Pointer-based implementation.
// ********************************************************

typedef type-of-queue-item queueItemType;

// The Queue is implemented as a circular linked list
// with one external pointer to the back of the Queue.
struct queueNode
{  
   queueItemType Item;
   queueNode*    Next;
};  // end struct

typedef queueNode* ptrType;  // pointer to node

class Queue
{
public:
// constructors and destructor:
   Queue();                     // default constructor
   Queue(Queue& Q);             // copy constructor
   ~Queue();                    // destructor

// Queue operations:
   int isEmpty();
   int insert(QueueItemType NewItem);
   int del();
   int del(queueItemType& QueueFront);
   int getFront(queueItemType& QueueFront);

private:
   ptrType BackPtr;
};  // end class
// End of header file.

#endif


Email Me | Office Hours | My Home Page | Department Home | MCC Home Page