Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List‐based stack
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- class EmptyStackList {};
- template <typename T>
- struct node {
- T data;
- node *next;
- };
- template <typename T>
- class ListStack {
- public:
- ListStack();
- ~ListStack();
- bool empty(); // submit code for this
- bool full(); // submit code for this
- void push(T); // submit code for this
- T pop(); // submit code for this
- private:
- node<T> *top;
- };
Add Comment
Please, Sign In to add comment