We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02c0f56 commit d72acf6Copy full SHA for d72acf6
Queue/01 Queue using array enqueue & dequeue .cpp
@@ -40,17 +40,17 @@ int dequeue(struct Queue* q)
40
}
41
return x; // and return it
42
43
-void Display(struct Queue q)
+void Display(struct Queue q) // function for displaying queue
44
{
45
int i;
46
- for (i = q.front + 1; i <= q.rear; i++)
47
- printf("%d ",q.Q[i]);
+ for (i = q.front + 1; i <= q.rear; i++) // traversing the queue
+ printf("%d ",q.Q[i]); // and printing the eleemnt
48
printf("\n");
49
50
int main()
51
52
- struct Queue q;
53
- Create(&q, 5);
+ struct Queue q; // making a queue objects in main funtion
+ Create(&q, 5);
54
enqueue(&q, 10);
55
enqueue(&q, 15);
56
enqueue(&q, 20);
0 commit comments