L=3
Le
Le) X
post
tevels
tongt:tia lett
rom filed&trctty be
must levee tat )
Cndikons
to bySat re
Bineng
Binary 1Atmost
plte com
4
cBT
(evet notest
Bme
EruetY Tee: Binany atComplete Leaf
3
F.BT
child eactya
nodes Iotnal tre Binany (strict Ful
FBTX
BT
hanode eoeh Dhich en tre t6
Tre’ BÓnoy
tree TPes
of
Lt eoeh chile trrom a nodefons vs
Parentnodeas
Sebtru
Toee Travens al-’ Atavenhal ofla tree Cs a
at eaeh verter Ob vcsited e aeettyt once!
that
pre-ordu) post -ordene) in-0nden)
i- Veit te root i) wt cab tree'en Trave En- orden
postora Jett subtse
a. Traverk lett Sudti pakt sq reea Viset te oet.
8. TraVes n-ondee
Right Ab tree
(AeD Ec) (DEB<A)
In OTder: BDAGECHFI
fre orde ’
ABDLEG FL
post ooder’ DB GEHTCA
Gbea Conneeted Tooth. Asy
s () tree on ecfed ond no Cydes )
miinal maumal
Spannine
Draw a compete graph k.
DTad find cs BPanm
4-2
skye's
ACom petegraph kn hel
tsee
a. select net ed wth mininal
2 wught trom enainng eolg such
that no any cycle es fornd.
3. Go on
On repeating the sep-2
Unelndge hawe be seleetad.
’mininu saming tree
2
B weght lt2t2+3 =
2
minimalD
*6Pennng tsee toucuret may be ibtrerent bsf
tgorthm (Tofinininal 8Prnnn t
H30thm
Prim)7
0 hos any veten on Sta from 7eves Vetea
cheek edges from verten' and seleet
nearut
jo2ning a verten, read Cnclvde to vectex
notyet inclvdeol 6
Contin tnt)) a n- Verct'es have beeo
by n e9es. A
3
Ba
2
2 D
342t1
a p&nd minimal Bpannirg. tree UMng Prim's
8 Kru8ha's agortth m
2
b
4
3|
2 S
2
2
Primb KrUsh ay
2
d.
b 2
4 2
2
2 weyht 2t3+2t2
TYt5t4 = 22
Wesht= 2t3+2t2 +y +sty
22
sd Late. tree
8s'8, sa o be lat eljed in Dhcl, ewery
Vete o4 tre has atne a unique label
Any albebic enprio cen be reprent oi
the hetp of tadeleg binary tree.
i ) Root of tre ladeled othicentrl
Cental operato respeetvey
ight argunents
9 eitker ps cantent oyVareye
lalel the corre ondo Veetea
naa operatos (+X,-)
Voriasle3
Contents
construct the
(7+()-())
(eaf nodeunstont
varuab[9
E0eenalnadl opto
Cong trvttree oY
3-(
Poltsh Notattong
pre-orde hen po -order toavene Ohen n-order
shac Peteed.
oeyalvation of pre-boa
23 @opsmon Cpoih Enprns
So1
to Righopera
t6s 2 34 Evaluate canita
Coninue Unty we
nUmbec
231
evalvaton of pt-bio
Evaluaf te_pos-bia
posf hia to m t n t t s
T?7-4193i1 (8- le oth only one numbe
-61
4‘93+
Iq3,t
933
Neto
qraph Snvolving a SoUrcce andink an o
Sewrl ether nodes Connet
of Aou0 that te netoorK 0ou allo to io)
Oiof
On tte famovs algort thn to Calclet
maimUm fow Cn thee netlork
Ford- fuhorson agorithm
soUce o8 a vertea ha only outwarde .
48nk Es a verten that has ony inward ege.
path 8s Called bote neek capaut
Bottle neex Capaechy of evuy ote orbitery patt
considert as fo .
Residvel Capary= cwerent capachy of edge
A. Pindout aimvn gtown geves graph
UKingy pord-Ful koson tgothm.
Sovree
steps choy an arctay
patt tosom Soutee to bin
step-2 pend botieneek
3 apact otsleekd path
( that wèll be our fo)
|sfep-3 0reite do0n botHe
neek Capathy weth cepaecy
of ede relett pat
sto s-a
4 frod=Stg
DO tlow=t3
maminum tow t ren nehoor Useng
DfiKstra's algortten
Wle) s
3
and shostet paty fromá'to '
Shustest path
2 path a’bCe
|2
2 3
(2 Sheste path= Qc
5 |3 (2 doslnee =5
5
maima ftow problem ford fet Kegsonrde)
e Forg futkercdon methad &s'aeor Sojveng
marimum fto pnlen.
.Basic tens
sourcce:The, SourLee varte hay a Qutuo
Sink: Snkoall have al noade,00
pettieneek' Capaey: BottHe neok
the patt, a tte mirimim capaciy
ant eg onthe path
Restdualcapaiy
Seidu al gafh hs avaue clle idlal
Capait ,which cA 2qval to ornl apaeiy
COerent ttou.
Yminus
cendte m a v u m T O 0 0 2
netoork Uigtoret fulKDon alorithn
2
o2 path Botte
lto
5
1-2-5-t
57
(-3-6 4
to=5 2
N
43
maamum fibad thoough tegiven netoo
S0
Uking forfekonsonl methodcsstyt24) 2
0 Sortion to tie single Sourei shortesf pat
problem Bgraphitheony!
Both dicekd 8 Undireeteo a,
( AH| R e must have non nogetive ght.
(A Graph must be conneeted
Remove al seltloop & arlel edg
ivo4 ph Travensal
in graph orde of vecttceg
also UNed to deetde te
9 E8 proces.
te Aearceh
to be velited in
trauer al tecntque
THPesoraph Stack IO)
COepth girstseaeh).
DES firdt Aearclh)’ ene | (PIEo)
A. BFS Breadth
DES (Deptt ferst tie
prodoces pannng
DPS toaersáll ofarafh
U 8ta 'dtastru tune
vevttte tnRet7raphAte mplemant
of tojl no. of
DeStraensal ofagraph
Atgorith of varctras
sze tafeino
Stept: peline a sfaek of
Step-: Select any veeteo al starthg pont
Vectea and pusht
on to tue staek.S
'ay one ofte adjatint verten
stey : VEsot
at top ofte Atae,
here aree no new
Step-y Kepeat 8tef-3, cente
Vetea to be veste fronth vecte on teetop
Ste-5 en tero os no vertia to be visie
nen
beeomes
Peet clepa ui uat sfaek becone
fp-6: Repeet
mptyythen prndce
Ohen Sfack becomes
fénal spanning tre by remoutng vnt 294
from
Cong dler tefollo@brg eanple.grafh, to
Perkoomm DES;oborg
Sfep: Seeet A as shotig
ivar’pugh Aontotaek tostning tre
Staek
ste2: vgct any adjacent vetea of'A hech
sk
SApushon to Bfaek
sfaek. ttoon’push
Steps
taeL thes from Dpop
backteoking. D
Tere
is 6ept
vertices,to none
be
A
0to Push
staes
D
Dsleps:
P
A
A
Ataek toon puhE
(E) vösitted not a¯CC). bit stepd:v
there & no new vertea
be vibiken
6ep-
So Ug baeutralk
’ pop fron sfeck
SPiDTheree s none vetea t be
Pso UNe beek taeu
G
A
’ Pop E fror sfak
A
Sfep12ND ne vertento be visite frvnc
B
A
B
omB. e
None Vetea to be vesed
slep-
baiktoeeking
A A
stecK.so taks
’ pop A from tae
AG
empy.so sfop Drsi travetal
’. staek bcane
Bseadts Ftt seareh )
BES(
ae spaningtree as afnalia
’ BfS poqvceg
elt fe graph wEthout loops, zi
vetces nthe fraph
Bize ofetotal nuobert
to Bnplenont Bfs ofegrah.
soze tofal no ot Verk
step: pe}one a Queue of
vertea as starting pont
stea seleet ang
te
Slep-s: vib8t al te adaent veeties of
Vertea whiche o t o h e awue @w,
net vesttedandAnsert them into T duy
Hep-4: Qhen tereo no 02 vetea to ba va
S quee ten delete
fsom the vetea at frontof te
Hat vutea tom te aule.
s84 until gulw becomeg
Ske5; Repeet slep 984,
skes
Step-b : t Qhen quuu becoms emp then prod oca
from tgreph
EaampleH
A
Sepislect Avetea a! 8tartng Pocnt
CD E, 8) ento Quem an
vhikd vrtes
’ fnsectnely ueae
elely
delele A fron uLDeu atos 20
Vuter
eB
hich arenot vieeq
slep3Vat aliadi(D)
yerte). (xy
pelete D from Qee
(c,F)
însert nelg vebtteo (
JSolete E
Netees <
’
steps
Delete Bfrom the eu. jatunuvorn
G
sler
v&sst all
vutea)
’ Dlete, F from quee.
2 c h ani not vELk
Sleps vist a ad/G)
(6)
beoo en py, so stop BAs Prnay
’ pinal result of BFS &s Bpenning to