Kwwiker

StackOnList.h

Apr 14th, 2021
595
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef __STACKONLIST_H
  2. #define __STACKONLIST_H
  3. using namespace std;
  4.  
  5. class StackOnList {
  6. public:
  7.     void push(int elem);
  8.     void pop();
  9.     int peek();
  10.     int getQuantity();
  11.     bool isEmpty();
  12.     void makeEmpty();
  13. private:
  14.     int m_quantity = 0;
  15.     struct Node
  16.     {
  17.         int info;
  18.         Node* next;
  19.     };
  20.     Node* head = nullptr;
  21. };
  22.  
  23. #endif
  24.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×