Guest User

Untitled

a guest
May 22nd, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. List‐based stack
  2. #include <cstdlib>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. class EmptyStackList {};
  8.  
  9. template <typename T>
  10. struct node {
  11. T data;
  12.    node *next;
  13. };
  14.  
  15. template <typename T>
  16. class ListStack {
  17. public:
  18.    ListStack();
  19.    ~ListStack();
  20.  
  21. bool empty(); // submit code for this
  22.    bool full(); // submit code for this
  23.    void push(T); // submit code for this
  24.    T pop(); // submit code for this
  25.  
  26. private:
  27.    node<T> *top;
  28. };
Add Comment
Please, Sign In to add comment