#include <stdlib.h>
#include <iostream>
#include <algorithm>
#define MAX 100
using namespace std;
void DisplayQueue(int queue[], int front, int counter)
{
for (int i = 0; i < counter; i++)
{
printf("%c", queue[(front + i) % MAX]);
}
}
void Enqueue(int queue[], int *rear, int *counter, char value)
{
if(*counter < MAX)
{
*rear = (*rear + 1) % MAX;
queue[*rear] = value;
*counter = *counter + 1;
}
else
{
// printf("Error: the queue is full.\n");
}
}
void Dequeue(int queue[], int *front, int *counter, int *value)
{
if (*counter == 0)
{
// printf("Error: the queue is empty.\n");
}
else
{
*value = queue[*front];
*front = (*front + 1) % MAX;
*counter = *counter-1;
}
}
