MCPcopy Create free account
hub / github.com/anupam-kumar-krishnan/Competitive_Programming / enqueue

Function enqueue

Basic Programming/queue.c:45–54  ·  view source on GitHub ↗

Function to add an item to the queue. It changes rear and size

Source from the content-addressed store, hash-verified

43// Function to add an item to the queue.
44// It changes rear and size
45void 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

Callers 3

TreecreateFunction · 0.85
LevelOrderFunction · 0.85
mainFunction · 0.85

Calls 1

isFullFunction · 0.70

Tested by

no test coverage detected