-
Notifications
You must be signed in to change notification settings - Fork 0
/
headers.h
48 lines (31 loc) · 1.08 KB
/
headers.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
46
47
48
#include <stdio.h>
#include <stdlib.h>
typedef struct node
{
int processID;
int burstTime;
int currentBurstTime;
int waitTime;
int turnAroundTime;
int priority;
struct node *next;
}node;
typedef struct Queue
{
node *front, *rear;
}Queue;
node *newnode(int processID, int burstTime, int priority);
Queue *createQueue();
void enqueueFCFS(Queue *q, int processID, int burstTime);
void enqueueSJF(Queue *q, int processID, int burstTime);
void enqueuePriority(Queue *q, int processID, int burstTime, int priority);
void enqueueRoundRobin(Queue *q, int processID, int burstTime, int waitTime, int turnAroundTime);
node *dequeue(Queue *q);
void showQueue(Queue *q);
void deleteQueue(Queue *q);
void calculateWaitTime(Queue *q);
void calculateTurnAroundTime(Queue *q);
void fcfs(int numberOfProcesses, int *processIDs, int *burstTimes);
void sjf(int numberOfProcesses, int *processIDs, int *burstTimes);
void priority(int numberOfProcesses, int *processIDs, int *burstTimes, int *priorities);
void roundRobin(int numberOfProcesses, int *processIDs, int *burstTimes);