/* stack_3358.h CS 3358 Fall 2015 a very simple linked list Stack ADT */ #ifndef STACK_3358_H #define STACK_3358_H #include // Provides size_t #include using namespace std; template class Stack_3358 { public: // typedef int value_type; typedef size_t size_type; // Default constructor. Creates an empty stack. Stack_3358(); //Copy constructor Stack_3358(const Stack_3358 & src); //Preconditions: None. //Postconditions: Destroys the list, cleaning up all resources associated with the object. ~Stack_3358(); /**************************** makeEmpty Method: Removes all the items from the stack. Preconditions: Stack has been initialized Postconditions: All the items have been removed *****************************/ void makeEmpty(); /**************************** isEmpty Method: Checks to see if there are any items on the stack. Preconditions: Stack has been initialized Postconditions: Returns true if there are no items on the stack, else false. *****************************/ bool isEmpty() const; /**************************** isFull Method: Determines if you have any more room to add items to the stack Preconditions: Stack has been initialized Postconditions: Returns true if there is no more room to add items, else false *****************************/ bool isFull() const; /**************************** push Method: Adds newItem to the top of the stack. Preconditions: Stack has been initialized and is not full. Postconditions: newItem is at the top of the stack. *****************************/ void push(const ItemType &); /**************************** pop Method: Removes topItem from stack and returns it. Preconditions: Stack has been initialized and is not empty. Postconditions: Top element has been removed from stack and item is a copy of the removed element. *****************************/ ItemType pop(); private: struct Node { ItemType value; Node *next; }; Node *head; }; /******************************* / Function implementations ********************************/ //... #endif