Homework Solution 1: stack.h
// My first solution stores represents the
// stack as an array.
class stack {
private:
const int MAX_STACK_ITEMS = 100;
int stack_size;
int data[MAX_STACK_ITEMS];
public:
stack(); // Constructor
int size();
void push(int i);
int pop();
};
Previous slide
Next slide
Back to first slide
View graphic version