Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __STACKONLIST_H
- #define __STACKONLIST_H
- using namespace std;
- class StackOnList {
- public:
- void push(int elem);
- void pop();
- int peek();
- int getQuantity();
- bool isEmpty();
- void makeEmpty();
- private:
- int m_quantity = 0;
- struct Node
- {
- int info;
- Node* next;
- };
- Node* head = nullptr;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment