You are on page 1of 6

Page No.

:
Date:

:1

As a)A tack ie a linea defa stmctune fhat


Eallows the LIFo (last-in-Frst-Out) erineiple
Stack has one and and on element ic dodded
intheStackit isadded on the top of the
Stack and the element Can be deleted onlu
Fxam the StacK
iD A _stack is_adata studuoé that cen
ae depre Sented as an arralef s leaxn
mMe ohautArray fepre centotion es a
Staak An laira issed 4a skere aa
Oidered ist af eloment.tsin4 an aTaY
oy epeSaiatcdion o StesKis one ok
ae dakau.But there is a maja dilLerence
hetween an aroy and a sfacK iS
S1ze a an ariayis gixed-Wkile, i
Staktuexeisnotixed Sze

PUsHi- When we nsed an eleneut


a gtask Haen dhe openotion Know
S a Puch
Behore insecting an elerment in StacK,
we oh eck wether fhe tack is ull
Twetg ko inSext he elementn a
Sta and the Stack s sull,Ahen dhe
Cpe oVen flaw Candion o ccUYS
when We 1nidiali2e d Stack, we Set the
Value o Leo os-1 do check dhat he stak
iEmpfy
henAhe cei elomert1 quched in.a doth
faG he Yalue L e , Aog 3ehs incse nerhed
i AoeAag Aia.Ond Ahe ckarsntut bb
plassd otthe.naw poiifian ot e.hog2l
T6ceexneshs La1ds d.unl.uEKuh
H h mak c i n o dheAea.
toshinala.alt

tops 4 4oQ10 0 p

goQ ogeiakonsc
ekesedelekins theelern.ent omthtistock
93 checY uheáhe he Shutk is erogky
I024 t g A delete Ahe elecotsst ksano Ae
emgty sheck, Ahenthe undestls CandiAlon
OcuS
15 he shack 1s n asAs e Ss arLess
thealetaest kich is painted oy the do
Ontethe Qog ope(akion
i ertoxncd, Ake Aec
14decxeeniec b1,1edo2z Hep-1
goHo

Ste
E
Page No.
Date

G-2
AbS-a)A stak isLa hndas odaha Shduckode Ahat
tallowsAhe to \astaineksouSpsisdile
SHac has ane end ano e anelemen 1
added 1n theStack,iitisaddod an 4he tep
OSMe tack, and the element Coan he delefed
Onyfom theStapk.
*ypeS a Queue
Rexe ae ou fe o Queue
)Cimle ueLe
he Simple qleye isd nomal, q0ele
uhere in Sextian 4akes place at he ront
The queue and deletlan take place o ENO ok
the q0eue
acular dedei-
oisalenqueue, the las riode i
Conneshed to the iost onle
CiKcula queue islalso Called as Bing Rallr
nSeiooio a ciicule queuehaop enSa
theFant and detekion a the nd o tthe
g ueue

7i ioity Queue:- g9o


Ln a piod queue, he neda) laaYe sane
psedolined Osisrit
Tnse4ion in a prietty 4ueue ispesfovme in
h e Arde oxri Yal a5 the eedss
he n.oe havi the Leest priosity uY Le
Hhe inst to be hembyed 51em The psiovhy
ueue
Paga Not
Oat
De queue DoublyEnded Ueue)
a Double Fnded aueue, tnse kion
nelelelio o opesotionS Cen hsidose at
eth EiontcandEnd.ab tk 94teuel
B Agosittano Eng ueuchz a
SLeps
1T REAR sze) then
Poinh ueue icull'
3) Exit
u) se
I LFRoNT 1)
FRONTe0lsn l
End i
2) REAR REAR 1 I/1n csemevt REAR
u eGueREAR 1TEM
1 Sop oi

|Agosthm or DegueUe:
Tt CFRoAT-1) then
PintQueue is empy L
3) it
4)Else
ITEM2 Que RoNTT
IF CFR E REAR
PEAR -1
3)
BlSe
FRoNT a FRoNT +1
End i
End iFE
Y3)4P
Page No.
Dato

aDheoidangenment ak data is a efered


enadex clledSoxting in tke data Stuciuse
Soxtiy dadn,its easiex to search thugh
LAlcely and easily
tSelecdion Sat
Tn_ selection sox themallepE Value
amang the ngaxtedelemeus of the ara
iS Seleeked in eveny PasK dnd lnserted ta
ifs _appxapriate postion into Aheaay
ISalSn tue snplest oaiiam.

23 342 AHS 3332


Accoxding o the merge Soxt ns4
diyidle the giuen cxxay nto twa equal
helVos

divide233u12 24
dvide23 34 24AS 6 9 32

Mesge23 34 H1 64532
merge 1223 3H 632 Lstg
mere 4|16 1223 32 3u Hs23
Now, fhe ana iS Co m pleeY Sated.
smiiex
belenent 4ho Cond13a0oS me
s.Coti0 AS

2A mulAi-dimen sional omay


oh osayS.

B2Babble S00t 1s a simple alg.ovithm


used Ao SoYt ogiven cek osn elemeu-
n Geo o an ortay Ahn numbe
e\erments

21 32

ta1a3l32
13324

92
/Vou Y 15 Completl sostel

You might also like