#include <stdio.h>
#include <stdlib.h>
typedef struct queue
{
int *arr, // array to store values
size, // queue size (array size)
put, // index location which the next value will be pushed in
take, // index location which the next value will be popped out
countVals; // Counts the number of values that the queue contains
} queue;
// queue nitialization
void newQueue (queue *q, int size)
{
if (size < 0)
q->arr = NULL;
else
{
q->arr = (int*) …Run Code Online (Sandbox Code Playgroud)