You are on page 1of 12

Name - Pihmijy'4 (huha

Rell ono -
ADTU/22-26/Bcfo75
Dept - B. beh CSF
Sée - A
Sob- Data Stohne &
Agonithiam
to hee
iona anes nsHhe heferemoe
cansioten a
orcdeeferedbionany
possiblypaoewsincg
mh tt otahogorook
node
!
umnibamy eaoh
,tuiallyexcept tnee
a
heal is headlist.be headionclkoy coonplek
can liot, hee e He
a ist emph consist
hz poiorten a bionary flle oenrepreser
fon he eperahoons,
Haniong be tre
mes loed epranerdhon a can a
ou ant thnoug provioes oub da gompletely
e
the a emy
tupesebhon dptakans a
nd
enswne
to
fon its gerahns
asavigtion varrious uo he '
io aoy
amayze noereasoms:
seenal ts eleent
fast
he hee'
bianay hich
andliot oeletans. trec?
bimany onoot e ty td
liot Binary per ahes
head sionplihes owoa leel,
ied Eopty plachoblen,
Citeolly the Bonphfed he laelo pno
liot one ot Conple
A Ahe sken peindt, hane laotThio wa
i tor
fom eany all
o Ame fo
bm as
Dfeenhte btoven

number fedges he bogestd poh tron he hoot


to a boat
Height ofa the The beilt 4a hee ia He leng.
4ia
f te logest pah fhoon he seoot to a leaf.
he mmeber egs oohe omhe neot o
He degpeyt nocke. 7he torms depth ad height an
ofen ved inhrahangeably.
State he vaiows transal amehda f apap
ba Dph frot trawenal (ors):-cn erder,
pre - orden mt post onden
Brcadh Fnoh ramersallBr):-Leel-orden
Dfewyfi beteen AVL tee and Bonany oeonel

mode fers by at most one.maintaios ta


balanee haough notats doriong inseodos and
elethos
Bimony Bearoh tee i-lBs) Abionay ta whee he
adnode coortains ooby moses cuit,
keys les han the orok'o hey ond he sight
Aubtee cotaions onty modes wih keys suokn
hon he mode'b hey.
Compane he toe conpenihy of he bionay scach
Algniton?
oCleg o), here mis he
Aoai Tione Coonplat: olloa
onber elemets ion Hhe 2onted arvay. This is
beoawe, with eoah comparùson, the seaeh space io
divided io half
Espain vaious appliahoo fatack:
fimohoor Gall Management(Reow Uoed to
omamage fuonetin callb, alouiong to he rete 4
valves on a Last ion, Fiot Out (I FO) mamnen,
Epnasionn Fvauao Hdpo ion enonta orithoma
orpnesioo by coomehonhm to pontfx prefe
anottioo.

implement vondo opeooons ian tot editoo


ooftworne ppiatioons
Evoluae e poato eopreioon vaio a otaal

A)
Token Aon
(3)
4 (3,4)
(*) (3*4)
(*) (3*4) 2
5 (*) (3 * , 2,5
(*),() (3*),(25)
+ () +(*) (8*4) +a* =
Ihe eolt io 22.

Diocun Hhe bianay seanoh lgonitnin bnief?


Aosn Bionany neaneh agonithm is om efeient
algnitm fem fiondag oa tongt vabue ithian a
ooted aray.
indal imhalf om ocomparimg the target vaeto
tangeh valwe io lem hamthe middle ,he
seaneh eomimes the louen half, her
0PPer hals. The pro cem the napeatk
cootiouesim the opper
beco ones empty.
Fohslioh a elahoo be tueem omoy ond poiode,
aay mame com be treaks as a
poioten to he finsd ekment 4 hu arnay. Fan nanpk
¡£it vnls] s om arnoyy , thun
Hen' a ' com be
wstd as a peioter to he forst element adar?
poimto o he oecmd elmed.This alahootip
alows avy uaiogpoinden
aritnahe msing and toailtales ymame.mmony
allocahoan usiog poimos
queue
a linean quee.
Aa iciend Memoy ilzhoos - Cinauan
ehointhy tilge omemony a hey can
cinoular queue avebtonet ion comdguous bloct
onemory, sinphfiong ionplemebtioon
Hate foura ferenoesben guick sont d
Menge
Vs, Mengiog
Jmdves partooning thu anoy basedoa a
clhonen pivot.
Morge aont: Jomolves mang iogg soned oub arnay
Shbility
Buik pont Not otable, as he nelatve omer f qual
elements may hange.
Merge sont'» 3tabe as he teltne onda is maintione
liong mengog
uik ont gownaly
amone, memony etheievd.
Merge noti Reqins aoblhooal opncefon mrgiog.
Reguies
onot ion ploree.
Aveag oase time
O(n leg on). bid may egnate to O()
îm he.wonot casc.
Alaays oor logm) but omay hame a highen
comotrnt footos.
Coment he infa epresoioon o pootte
Aos
Jonn Stock Pootfn
K K
+

KL

KL+
M
KL+ M
KL+M
KL+MN
.KL + MN*
kL'+ MNA
KL +MN
kL+ MN*-O
A KL +MN*-o
+(A
+(^ KL+MN -oP
KL +MN-OPa
KL+MNt -OPA
KL +MN-PAN
/
+/ KL+MNPAW
+/

KL+ N -OPAW*U/
+/ KL tM -OPn W*u/V
KL+MN-ÔPAW>U/V/
T KL +MNt-OP AW U/v/T
KL+MNA OP^ W*U/r/T
+ WU/v/T* +
KL +MN -0Pn
kL+MN*-OPAWtIT9
KL+MNt -0PA W*U/ V/T&+
The fmnal enpression ia f (k+h - MtN +(0^ p)*wAN
*T + ) i KL + MN -OPAwt u/v/T* +8+

GDo unhe bgie to pofoam he folowong opoahos


he followiang phatioms onn a linked la.
Aony'@Set atthe toat Alocate memony ton aaew
onode. Bet he daa fhe vew anade
Isent at the midle Traeneto he midle
posithon. Alcale oemony ar a Mew

Tanerse to Hhe end he


a mew mode, s t h at
Jibt, allo cate memony fon

() Tbtnate the mes fon mamic menmory


allocton onen otate allocatom?
Aoss Sn otae memony emony alo cahoon
cahoor omee he meomony
To allo cates, he enony )3e onot chamg. &n honamic
omemony alocotoon, when omemony io allocated he
be dhanged. Bon this memor
alo cahon sheme, we cannot eue t vswscd
This allows n upiog he memony.
Comthuot he bianany
Aos
The

(18 Amnalyge the advontgo anedadvondhges


Iiok-lit Oei
onmay?

Dranom'e ojze i-Linhed dioto


ohnink in ge duniog nome
Efoint insetnioos
omd deletovs sfelements
coompaned to aay, espeoiolly ion tth midd le.
No wasta f omemony, Monony o
ncded. alloatdas

acces sbven coompares to arays


sionce elemnnto ae aocermed oeguentialy.
A Reguines addihnal memony fon he atonag
of poinkey.
OFtra ovenhsd ton omaiontaiiong poide
allocatiom.
noot t
he ovbtree
ft mel nubhe lat the imonpde Nsoben 1
onder Prc =
Pootonder =
Sononden -
oepvemaes
wence,loser taenad
co peonden
coaeetoovs nepresert ds
lbhcomhipo
d vaiows
ne hane may Veticn O
atouad. loops ndGces
edges yol Cmodes verte pintiona coon
rutne hieaheal
dta Non Gmaph:
O
bhons
hip child paed- hasa eode Eoch O
cyeles
on ONo
aloued. ane hoops
nodes leaf leadiny
to bnoches md node
noot wih otructune Hierahiad
doda O
Aons
(50
(5)

(53

The mumbu mes he lellubhe an


ouiht oubtee d he zoot tespechvey is (4, ).
Ao
push (s4) puah(s) pop() push(s5
op top Hop top

52
G4 54

puahla)
top S= pop) 62
55
|54

emqenla)

24 Reas
dayve () enquea)

rod|24 Roan Resn

emqvee(a)
24 28 32 |Reo

$+4, = 62t24 = 86

The vae s S+q, 6

Aog is AAonoma yueue, if ibmplemenaded uoiong


arnay foize MAX-SIzE, b full when Raa
Rear = MAX_ SIZE- 1,hene wl be
the clemerts to be added in queue .. TRio to because
oa He
fn
oMe popiHo mio always eseed to iobagincd
behen
an Aos' Gueue ollows FI FO gpnoash ie
Fnst ion Fist Out so he oaer f nemoal.
elemment will be A,Be,0.
cam

anay

You might also like