Header File for Stack ADT - List-based Implementation


// *********************************************************
// Header file StackLst.h for the ADT stack.
// ADT list implementation.
// *********************************************************
#ifndef STACKLST_H
#define STACKLST_H

#include "ullist.h"     // unordered list class

typedef listItemType stackItemType;

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

// stack operations:
   int isEmpty();
   int push(stackItemType NewItem);
   int pop();
   int pop(stackItemType& StackTop);
   int top(stackItemType& StackTop);

private:
   List L;  // list of stack items
};  // end class
// End of header file.

#endif


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