Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions DS and Algo/dispqueue.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
Let's display th elements of a Queue.

Now, you already know that we have to check for the condition if the queue has elements or
it is already empty.

and the "isEmpty()" function, we have describe before.

*/


void display(){
int element;
int i;
if(isEmpty()){
printf("Queue is Empty!");
}

else{
for(i=front; i<= rear; i++){
printf("%d",queue[i]);
}
}
}

/**
We can also print the data in the reverse order i.e. from rear to front direction.
Just reverse the loop.

*/