0% found this document useful (0 votes)
9 views

Votd Displa) : Rmetartion

1. The data structure implements a circular queue using linked lists. 2. It allows the user to insert elements into the queue, delete elements from the queue, and display the elements of the queue. 3. The main operations performed are insertion at the rear, deletion from the front, and traversing the queue to display elements.

Uploaded by

Bharath Ane Nenu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Votd Displa) : Rmetartion

1. The data structure implements a circular queue using linked lists. 2. It allows the user to insert elements into the queue, delete elements from the queue, and display the elements of the queue. 3. The main operations performed are insertion at the rear, deletion from the front, and traversing the queue to display elements.

Uploaded by

Bharath Ane Nenu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

#+include e stdio.

hs poirrtt ("Emter yeur chaia:")


include <stdlib.h> Scanf (.d, choice
Stuct node
Switch (choice)
int data
Stouct node mext case 1:pint C Exter -the
|3-Prontt =NULL,Ea ENULu value t be insevt;");
vojd fnset (int); SCanf (Yd",value)
void delete () fnsex-t (value)
break;
votd displa);
Case2 dJete); break;
Void main )
Kase 3 displau 1; bveak;
int cho ice, value
Case 4 Erit(o);
pointf ("n:: civcula queuedefault: pointf(In wson
imple rmetartion using linked selection !l pleosety
oqpin

uile (1)
t pstnt 'int*pmenu*in
void insert (int valua)
Pvintf(" 1Tnsertna,Deleteln
tStuct node nn
3.Displo-yIn.Fttn); nn-(Stnuctnade)malloc(
of (stmuct node)) TeaTnext =ortt
nn-data = value
Pree ternp)
nn H e t NULL;

Hfsont-aNULLKKEaT=NULLVoid display)

Struct node* -temp


CO>nex-t2fooTt;
temp-toonrt
else
Tea> next 2nn
NULL))

nn next:frortTt;
printf("In Qutue is Emgty);|
else
prirm ("n Ingstion Sutlessn) a
do
Votd delete) psintf ("Ind"-temp-dit)
strct node-lemp tempe -tkmp next;

-temp-ont
PPrort z=NULL)KK(stATwhile
ohiletemp!frt);
NuLL)
sintf(noueue is Empty")
else tF(Psont== vea
Fsont "vEaT NULL

fsetenp
else

frontefront->nert
Ciscular gueue implem 20
30
-entation usin9 linked

Rst Eter yrou cholce: 2


**MENU* *
dequed 8lement 2 o
.inser-t -X9r
2 , delete
Entersous choice ;3
hros1)
3,dis pla 20
30
.Exit
enter our Choice : 1 Enteou choice u4
Erte 4he value to be
P m ends
inser-ted io
d
Enter your choice :1L
ssj-bor duoe
Erterthe vaue to b e

inSested 20 3)liee -a)elCuue ro )


Enrterou choice ;1

Enter h e value to be
o r - Jmo-)+ 215
inSeted; 30

Ente ous Choice 3

16
VIVA QUESTIONS| Lab Record

1. List out the memory al location


functions? bfup
Ans.naloc C), calloc ) ,
mems
aloc, toee) ave-he
aloca nfun ctions. at 5v)s(e
2 Define circular queue?
Ans. Ciotulars queue lineas data stmucture o
in whteh he
OPertfons ns_oscfPefsornee based on
Pev Ott) FIFo Ffost fn
3 List out the
advantages of circular queue?
Ans.
Tofes o 9ulc and claan uay to stove FIFO dada colth a

maoinuna Sf2e, 2) onsersve memo o_we onu Stove up


tou opaci
4. What does a node
define?
Ans. 4mode is a loasie untt a dota Strudtuse, Such
aslinted
tOs tste d stauctune, NDde Contatins_dta a
5.
lso ma lnkt oth nodes
What are the different
types of circular queue?
Ans.
ple gueue, cf'vcular queue, potovity gueue, Double
Ended9 n e ATthe_ditfevent types diacal
6.
9ueue
What are
are the different erations performed on acircular queue?
Ans. Eng ueue,
degueue hont d t ,fs cmpty, is ful ave
the dtfcsent opesotions_perfomed m
Crscula eLe
69
Data Structures using C=

7. What are the advantages of circular queue?


Ans. )T otfer a 9uick and dean way bo sore Fpo d
W Eha mooinmum SI3e_
on enveg mernosy o c mkS-tove up to
opacit

You might also like