AWA
io mty Bueue Date
Page No.
Pmomy queuls JsE k monmal
9uene dalo stTo exCept tha eaCh ellmant
mserted i s asso otid +h a prmormy
Man ways e Gm mptoment gnt bes
opton Balaned e inauy Toee)
Use Heops
Henp . omplat 6imayTne
2 Heop ondonPocpely
Examplo
AAA
Inbuilt Pmority &ueul >
Tinclude <ULuL27
empty) SizeC
PUsh C toeC)S PoPC
Py defalt Mgx piomity 2uau
Jnbult Mim Prmio.8u > Pmomh_uele cin+, Vecton Zm>
PneateN Linias PC
1.K -Smallos+ Elemont m +he armay
1. Ose Max Prmomly uut
2 Insen all +Ae ewmnis i P
3 Thon pemove (n-K) elemem tom
+he P fpom toP
The Stope Rgmainin9_ elomens
P aUalable
Date
Page No.
. -Larg est Eements
m +ne Same efova
i n heop/Nar heap.
3 Guen am Aiand Check Max -Heop on Not
0o = poot botn Cildnen
(Jeft)
212
(rhe)
(O41 (242 be Grofu
tNhen otou Ceck
. Kan Lorgest Elemamt
max neop
2 PUsh allelemegS Omd pp
lemenS
3. Thh peton moW top eOMQITA
Merge K Sooted
Aro 5 6 1o 25
A L 2 28
5 2
A 239
A 2 2 29
ymde
Date
Page No.
Tmploks> elkments, away Index
CUmen JnPxK
Ome fvnny Appnoach
L Ha )
Stowed emosns into
ve t o Sora
H
Toplets Imsent
Min -+eop
Deuidin raCkon- elemens.
OCl0,20,?O)
5, IS>
2Z91E
CRetom elman
inse Hhe olment (nfx +) froom
Carrn)hnch t Rnnet Pope d ).
fo imsert_ARst menE Of oll t
AT ClasS
2 m lomp dunctio09 tho uillfo t
Pmo oh 2ueue bae On elCOus
Henote up-to +e_Pmom y
veu + vpty
THeM top LOmeN inset H
Vector
5- T m PUsh ext elemen
CUme aMa _poppes
( CecL anay_ ypky on
n0t)
Date
Page No.
6. nd Median iin ( P u i n Medi an)
Median SOoted ameuy md OTmOt
middl Odd Singuo olu
on even avg o md two Ualmo
amT 5,15,i,32
5
5,15
5
LSTS/2
5,151
51S,13 Y (3t5)/2
51015, 1 20,13
Sllo MPdan gneten Hol
tall
Nolntou' n 2)
Sn oulln
Hol
ente
Containen
Tomoumey.
Chch em
t w o erianen Size no t+
Sorne Mediom fhask ontainln Tep
eise ( iost Cmtat ToPt seoml Contoie Top)/2
i Cmot balanme d
1 Cel ement less hon
ese-
m ar
eAse
Page No.
7B the titket
Cti ven +he o 0} PeOple and peoplL
wth +heio Pmomty.
ien at m de x
WhChn
am. Cer me i n e Col culoto)
Pmoity aed Seruce Not nst CU)
ivst baoe Sertui ce2
Ls19y
tAeN ne O
me-
Ueul Todex Stoned4
ax foormh 9ueu elomom+ StonedN
4ecoto a leoP
mle toont ()I=k n top elmen
O PL m et uu+h
rOn
top UumCE O p oote
hAN(ftoonttPmeNt bact-PU
2ASe top etemont OE P= twon
etenneat
FM P2.PoP) 2.PoPT
petum Hmetl)