CS3413/Assignment8/code/disk.h
2023-12-02 23:14:09 -04:00

29 lines
564 B
C

#pragma once
typedef struct DiskRequest {
struct DiskRequest *next;
int position;
int time;
} DiskRequest;
typedef struct DiskQueue {
DiskRequest *head;
int size;
} DiskQueue;
typedef enum DiskDirection {
UP, DOWN
} DiskDirection;
DiskQueue *createDiskQueue();
void enqueue(DiskQueue *queue, int time, int position);
void delete(DiskQueue *queue, DiskRequest request);
DiskRequest *dequeue(DiskQueue *queue);
DiskRequest *findClosest(DiskQueue *queue, int position, double time);
void destroyDiskQueue(DiskQueue *queue);