-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQueue.h
45 lines (28 loc) · 862 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
39
40
41
42
43
44
45
#pragma once
typedef struct CLIENT {
char name[41];
int id;
bool operation; // true -> Put away money | false -> Withdraw money
float amountMoney;
char type; // 'M' -> Pregnant & Premium 'E' -> Pregnant | 'C' -> Simple client | 'P' -> Premium client
int number;
} CLIENT;
typedef struct Q_NODE {
CLIENT value;
struct Q_NODE* next;
} Q_NODE;
typedef struct QUEUE {
short int numberOfPendingShifts;
Q_NODE* head;
Q_NODE* tail;
} QUEUE;
void create(QUEUE* que);
void queue(CLIENT value, QUEUE* que);
void priorityQueue(CLIENT value, QUEUE* que);
CLIENT dequeue(QUEUE* que);
void attendSpecially(Q_NODE* pregnantWoman, QUEUE* queue);
Q_NODE* isThereAPregnantWoman(QUEUE* queue);
bool isEmpty(QUEUE que);
void freeQueue(QUEUE* que);
void createPtr(QUEUE** que);
void freeQueuePtr(QUEUE** que);