forked from 2unaa/Intro-to-Data-Structures
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue.h
More file actions
42 lines (35 loc) · 617 Bytes
/
queue.h
File metadata and controls
42 lines (35 loc) · 617 Bytes
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
39
40
41
42
#ifndef QUEUE_H
#define QUEUE_H
#include <string>
using namespace std;
//create an enumuration type
enum op {ADD, SUB, MULT, DIVI};
//create a struct that will have an operand, a operator, another operand
struct expr
{
int oprd1;
op oprt;
int oprd2;
};
const int MAX = 10; //size
typedef expr el_t;
class queue
{
private:
el_t el[MAX];
int count;
int front;
int rear;
void queueError(string msg);
public:
queue();
bool isEmpty() const;
bool isFull() const;
void add(el_t e);
el_t remove();
el_t getFront();
void goToBack();
int getSize();
void displayAll() const;
};
#endif