Nihar Deshpande Data Ass
Nihar Deshpande Data Ass
DatedASSMate
Paga
Arsignment -| TREE)
2 marks
Show tue steps ot ceatin o binarys
Cu tree for tue following datai
LS 90,20,s 0 2,
(13)
clPagaasssnate
Date
of
any two applicati on
||. List
ree dato
Sture
Hierarical data structre
Data base indexina (8ST
J2.
what isSkewed binary ree)
AA Sk ewed binary ree
bioary tree io wiu
type ot
ttue nodes
are
arranged in Sucl a way Haat t
exEend
only ue one directioYn elthe
Completely to left or ompletely toke
tue niat:
Types of kew ed binay tree are :
left ckewed
Riqut kewed.
Q3 4 marks.
13 write
ite re ursive funcion io'c displau
and cownt leaf node non-eaf
nodes of brt
Cownt Leat ( TREE * noot)
Satic intleaf =O,
NODE * temp = T00t
nt Count_nonLeafTREE noot)
Static int
if Cro0ot == NVLL)
return Cnt,
Cnt tt
write aCfuntiom to
an elemeut
8ST.
Void iosert(TREE
int tao =0
TREE * paret
por * temp
1teup = paret i
poreut= pareut ’ riqut
|S.
write a
C pr o ompare two BT.
int Compare BST TREE AtTREE
A t, t)
Statie int f g =
1 f ( t | = NULL 4 t = z NULL)
return
elre(t NULL 44 ta|ENULL)
iE (t ’ data = t2 data)
ifCompare BsT( ’ t , t2’e=l)
Co mpare 8T(tI’iqut,t 2’riqu
ele
'egu'
classMte
Date
Page
nodu
to inSert a teet
into 8ST:
Q4 3 marks
Define ue followinq terms
te
)Terminal node-The nodes wit no
Sub trees are caled te minalnode
2 Deptu of node - Total no of nodes
edaes from root partila no de
Call ed duptu f ttat node
3) root nodQ In tree datoa shructure
tue firt node from where tw tree
Oriqinater lled as a oot node
2)
2 Crive inoder preorder aud postord er
trauena for:
00
too
"Inonder i 60 700o0 120, 1S0 a00
Preorder: |20 60aO 70, 00 2004
Postoder 70 |00, qO, 60 1S0,2 00, |20
Thorder BAD£IHt
" Preorderi A,B E,HLL
Postord er B DIL, H,E,A
Date
Paga
3)