MCPcopy Create free account
hub / github.com/3rfaan/courses / Enqueue

Function Enqueue

C/freeCodeCamp/Data Structures/queue-array.c:24–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24void Enqueue(int x)
25{
26 if ((rear + 1) % SIZE == front)
27 {
28 return;
29 }
30 else if (IsEmpty())
31 {
32 front = 0;
33 rear = 0;
34
35 queue[rear] = x;
36 }
37 else
38 {
39 rear = (rear + 1) % SIZE;
40 queue[rear] = x;
41 }
42}
43
44void Dequeue()
45{

Callers 1

mainFunction · 0.85

Calls 1

IsEmptyFunction · 0.85

Tested by

no test coverage detected