You are on page 1of 8
Fa, POORNIMA INSTTTUTE OF ENGINEERIN TECHNOLOGY DETAILED LECTURE NOTES PAGE NO, | HF Opexation on Binary Tree ¢- ] | M Traversal apa binary tee | | © Thsextion of Noes @ Deletion of ner @® Seaxckivy gor the Nodes, | @ Traversal ofa binaxy tree Ly Fravesal isa proce to Vlalt all the nedes ofa tee and ray paint sthely Values ‘oo- bs AN nodes axe Connected via edges Chink) wc alumys stax sprorn the xo (head node. by Tntvee Creation coe take three fpaxametexs node , lettchilal, and signt child , So teaversing of binaxy teee means teaversing of Rade , lett, & kight Subtest ec axe three aOhich ox Une to teavernea teec, Pre-osoler Apex ofdler Traveoaol | | | b | Sate © ' & @ (Ole ie is - \ eS er pa a, => Represent: Steuch bnode £ Char data 5 e brecle % ley}! bnode x yight), 4 we Noid preadex (Node x seat) : Ty C tec [= Nol) & Pt ( "%adc “) eotvee dota); preorder (tycea Jett); preorder Ctree 3 bight), POORNIMA INSTITUTE OF ENGINEERING & TECHNOLOGY DETAILED LECTURE NOTES PAGE NO 2. In -Orvder Traverbal 3- ic ae Rook - Right) ® procera the le} Subtree In Inovclex CL) | ® Pryocena the Root (N) © Travere the Sdghh Subtsee (noydex CR) ea, __—___@— Enorder trove out t- DB ,eAic F Re proseuk 9 Sructynode @ sto Algo t= Inordex (Tree ) \ Begin 2) Tp Tree Not equol toNULl tren 3. cold Thoscle (Lept CT ree) 4. corte: Bata Civee) Ss Cal Inovder (Righh CTree]) Cena of 5+ 9 6+ Reto, ® Post ovclee Haverad eo Leyt- Right — Root Se O Traverse +he ley} Subtree in bostorclex CL) @ Traveus the Fight Subltee (n postorder (R) @ @ Procomphe yoo (N) INSTITUTE OF ENGINEERING & TECHNOLOGY (6 Poornma — be TaN a td PAGE NO. Postasdex (Tree) | ht Begin | 2. Tp Tree Not equal to NULL then | 3. Cad postorder (lett Cree J) ‘ U. call postosdex (Right CTvee)) | | S. kivite | Cato LTveed | | [end of eel 6. Return. oo \ ihe preowler Q postorcleg €4i~ Create a bin tree Q ural preo ee ° dy Axe Binaytee’- ZX eS 7) a (Root-Le rt - Right) > *AB pimdiecs-Rigny- Root) 7 ABY Preovcter s- / ASS Pastorcler \- ABTS | @ atea/e x Binary Tree {- Preorden'\- +A] BC Postenler:- ABC /+ ae Preorder 3- j-nsrs be ~ *~ Pstordex 6- AB-CD KE +/ ran ae a A 8 ae < res CoO Preorder = /- ABACD Postorde=AR-CDOA/ Poo SOGGY INSTITUTE OF ENGINEERING & TECHNOLOGY PAGE NO. evosee Preorder = AB c Postorder= BCA Tnordex = ABAC Postordex= DEBCA TInosdex = DREAC Pre OYA ee — Count!) ABDES Tnorder — Cxink-2) pDBeAC Postosder - Ctount-3) peBcA Pre oxelex S— Count | ABDHTECRT AKL Postorderx’- Count-3, HIP ¢BIEKLACA TAN Inoxder %- Cound - 2 Hor Re AFITCK GL Preorder = Count= | 124499362 fostorder = Gunt3 TOsPenmetes gquss 263) nord ex = Comb 2 Fgu2s1 368 © Preoscler = 39,20,10,16, 25123393542, Postorcler = 1G 10,23 2H 2 01 3S/42 39,50 Tnorvdex | {Oi (5 20,23) 2 5, 30,35 3442

You might also like