Advertisement
Guest User

header.h

a guest
Mar 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. #pragma once
  2. #include <iostream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. struct Stack
  8. {
  9.     int val;
  10.     Stack *prev;
  11.     Stack();
  12.     Stack(int newNum, Stack *newLink = NULL);
  13. };
  14.  
  15. class StackClass
  16. {
  17. private:
  18.     Stack *top;
  19. public:
  20.     const string typeName = "stack";
  21.     StackClass();
  22.     void push(int newNum);
  23.     void travPrt(void(*print)(Stack*));
  24.     void pop();
  25.     bool isNull();
  26. };
  27.  
  28. struct Queue
  29. {
  30.     int val;
  31.     Queue *next;
  32.     Queue();
  33.     Queue(int newNum, Queue *nextLink = NULL);
  34. };
  35.  
  36. class QueueClass
  37. {
  38. private:
  39.     Queue *front;
  40.     Queue *rear;
  41. public:
  42.     const string typeName = "queue";
  43.     QueueClass();
  44.     void append(int newNum);
  45.     void serve();
  46.     bool frontNull();
  47.     void travPrint(void(*print)(Queue*));
  48. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement