Skip to content

Commit d72acf6

Browse files
authored
Update 01 Queue using array enqueue & dequeue .cpp
1 parent 02c0f56 commit d72acf6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Queue/01 Queue using array enqueue & dequeue .cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ int dequeue(struct Queue* q)
4040
}
4141
return x; // and return it
4242
}
43-
void Display(struct Queue q)
43+
void Display(struct Queue q) // function for displaying queue
4444
{
4545
int i;
46-
for (i = q.front + 1; i <= q.rear; i++)
47-
printf("%d ",q.Q[i]);
46+
for (i = q.front + 1; i <= q.rear; i++) // traversing the queue
47+
printf("%d ",q.Q[i]); // and printing the eleemnt
4848
printf("\n");
4949
}
5050
int main()
5151
{
52-
struct Queue q;
53-
Create(&q, 5);
52+
struct Queue q; // making a queue objects in main funtion
53+
Create(&q, 5);
5454
enqueue(&q, 10);
5555
enqueue(&q, 15);
5656
enqueue(&q, 20);

0 commit comments

Comments
 (0)