-
Notifications
You must be signed in to change notification settings - Fork 0
/
queue.h
38 lines (28 loc) · 854 Bytes
/
queue.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once
#include <iostream>
#include <string>
#include <memory>
using namespace std;
class queue{
public:
// Move to private. create accessor and mutators
int size = 0;
//-----------------------------------------------------------------------------
//Mutators for queue
void push(string topush);
int pop();
//-----------------------------------------------------------------------------
//Print- prints queue
void print()const;
private:
//-----------------------------------------------------------------------------
//Node struct- used to store a postition pointer and data variable
struct Node{
shared_ptr <Node> next;
string data;
};
//-----------------------------------------------------------------------------
//Positional pointers
shared_ptr <Node> current = NULL;
shared_ptr<Node> head = NULL;
};