| 43 | } |
| 44 | |
| 45 | void Display(){ |
| 46 | struct node *temp=front; |
| 47 | if ((front == NULL) && (rear == NULL)) { |
| 48 | cout<<"Queue is empty"<<endl; |
| 49 | return; |
| 50 | } |
| 51 | |
| 52 | cout<<"Items present in the queue are: "; |
| 53 | while(temp!= NULL){ |
| 54 | cout<<temp->data<<" "; |
| 55 | temp=temp->next; |
| 56 | } |
| 57 | cout<<endl; |
| 58 | } |
| 59 | |
| 60 | |
| 61 | int main(){ |