Posts

Showing posts from September, 2020

Write C++ program using STL for implementation of queue using SLL.

Image
 Write C++ program using STL for implementation of queue using SLL. #include<iostream> #include<queue> using namespace std; OUTPUT FOR THE PROGRAM int main() {    int data,i,n;    int ch;     char ans;        queue<int>q;    do    {       cout<<"\nQueue Using STL";       cout<<"\n1.Insert";       cout<<"\n2.Delete";       cout<<"\n3.Size ";       cout<<"\n4.Display Front element";       cout<<"\n5.Dispaly Rear element";       cout<<"\n6.Display All Element";       cout<<"\n\nEnter your choice : ";       cin>>ch;       switch(ch)       { case 1:               if(q.empty())       {                   cout<<"\nHow many elements do you want to insert : ";             cin>>n;           for(i=0;i<n;i++)                   {      cout<<"\nEnter "<<i+1<<" Element :";