EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

#include<stdio.h> #include<conio.h> #define SIZE 5

int front = – 1; int rear = – 1; int q[SIZE]; void insert( ); void del( ); void display( ); void main( )

{

int choice; clrscr( ); do

{

printf(“\t Menu”); printf(“\n 1. Insert”);

printf(“\n 2. Delete”); printf(“\n 3. Display “); printf(“\n 4. Exit”);

printf(“\n Enter Your Choice:”); scanf(“%d”, &choice); switch(choice)

{

case 1:

case 2:

case 3:

case 4:

}

insert( ); display( ); break;

del( ); display( ); break;

display( ); break;

printf(“End of Program… !!!!”); exit(0);

}while(choice != 4);} void insert( )

{

int no;

printf(“\n Enter No.:”);

scanf(“%d”, &no);

if(rear < SIZE – 1)

{

}

else

{

}}

void del( )

{

q[++rear]=no; if(front = = – 1)

front=0;// front=front+1;

printf(“\n Queue overflow”);

if(front = = – 1)

{

}

else

{

}

printf(“\n Queue Underflow”); return;

printf(“\n Deleted Item:–>%d\n”, q[front]);

if(front = = rear)

{                                                                            output

}

else

{

}}

void display( )

{

Front = – 1; Rear = – 1;

Front = front + 1;

int i;

if( front = = – 1)

{

printf(“\nQueue is empty… “); return;

}

for(i = front; i<=rear; i++)

printf(“\t%d”,q[i]);}

Array implementation of Queue in Data Structures

Leave a Reply

Your email address will not be published. Required fields are marked *

EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Popular Courses

[Course Image]

Introduction to Programming

Learn the fundamentals of programming with Python in this beginner-friendly course.

12 Hours Beginner
[Course Image]

Data Science Essentials

Master the basics of data analysis, visualization, and machine learning.

20 Hours Intermediate
[Course Image]

Web Development Bootcamp

Build modern websites with HTML, CSS, JavaScript and popular frameworks.

30 Hours Beginner
[Course Image]

Digital Marketing Fundamentals

Learn SEO, social media marketing, email campaigns and analytics.

15 Hours Beginner
Educational Website Footer