Leedwon

Untitled

Mar 19th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #ifndef STACK_H_
  2. #define STACK_H_
  3.  
  4. template <typename Type>
  5. class Stack {
  6. private:
  7.     struct Node { Type item; Node * next; };
  8.     Node *mFront;
  9.     Node *mRear;
  10.     int mSize;
  11.     int mItemCount;
  12. public:
  13.     Stack(int size);
  14.     Type pop();
  15.     void push(const Type &itemToAdd);
  16.     bool isEmpty() { return mItemCount == 0; }
  17.     bool isFull() { return mItemCount == mSize; }
  18.     ~Stack();
  19. };
  20. #endif // !STACK_H_
Add Comment
Please, Sign In to add comment