stack.h
const int maxSize = 50;
template<class T>
class Stack{
public:
Stack(){};
virtual void Push(const T &x) = 0;
virtual bool Pop(T &x) = 0;
virtual bool getTop(T &x) =0;
virtual bool IsEmpty() const = 0;
virtual bool IsFull() const = 0;
virtual int getSize() const = 0;
};
SeqStack.h
#ifndef SEQSTACK_H
#define SEQSTACK_H
#include "stack.h"
#include <assert.h>
#include <iostream>
using namespace std;
const int stackIncreament = 20;
template <class T>
class SeqStack : public Stack<T>
{
public:
SeqStack(int sz = 50);
~SeqStack() { delete[] elements; }
void Push(const T &x);
bool Pop(T &x);
bool getTop(T &x);
bool IsEmpty() const
{
return (top == -1) ? true : false;