






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Title:
Objective:
Equipment Required:
Stack data Structure:
Queue Data Structure:
Task # 1: Write a program to implement following operations of stack using array data
#include
cin>>val; push(val); system("cls"); break; case 2: pop();Sleep(2500);system("cls");break; case 3: display();Sleep(2500);system("cls");break; case 4: cout<<"Exit"<<endl;break; default: cout<<"Invalid Choice"<<endl;} }while(ch!=4); return 0;}
Task # 2: Write a program to implement following operations of Queue using array
#include
int main() { int c; queue qu; do{ cout<<"\n\t\t\t>>>>>>>> Menu of Queue <<<<<<<<"; cout<<"\n"; cout<<"\n\t-------------------------------------------------------------"; cout<<"\n\tENTER 1: Insertion"; cout<<"\n\t\t----------------"; cout<<"\n\tENTER 2: Deletion"; cout<<"\n\t\t----------------"; cout<<"\n\tENTER 3: Display"; cout<<"\n\t\t----------------"; cout<<"\n\tENTER 4: To Exit"; cout<<"\n\t\t----------------"; cout<<"\n\n\tPlease Enter Your Choice: "; cin>>c; switch(c){ case 1: system("cls"); qu.enq();system("cls"); break; case 2: qu.dque();Sleep(2500);system("cls"); break; case 3: qu.disp();Sleep(2500);system("cls"); break; case 4: cout<<"Exit"<<endl;break; default: cout<<"\nInvalid choice !!\n"; }} while(c!=4); return 0;}