Function to add an item to the queue. It changes rear and size
| 43 | // Function to add an item to the queue. |
| 44 | // It changes rear and size |
| 45 | void enqueue(struct Queue* queue, int item) |
| 46 | { |
| 47 | if (isFull(queue)) |
| 48 | return; |
| 49 | queue->rear = (queue->rear + 1) |
| 50 | % queue->capacity; |
| 51 | queue->array[queue->rear] = item; |
| 52 | queue->size = queue->size + 1; |
| 53 | printf("%d enqueued to queue\n", item); |
| 54 | } |
| 55 | |
| 56 | // Function to remove an item from queue. |
| 57 | // It changes front and size |
no test coverage detected