0% found this document useful (0 votes)
21 views

Ds Assignment 2

Uploaded by

Bharath Ane Nenu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
21 views

Ds Assignment 2

Uploaded by

Bharath Ane Nenu
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 10
| Discuss Concept OF AVL: Tree and “Mt Rotaston jwith an example. | AVL tyvee named Ober dhets invertase GM Adelson-velskit and EM. Landic. ANL tvee altO Known oy “Heian -balan tree”. Tk ts a speriold Kind of Binas Search Avee, oni Sakistie¢ Whe 4a die woo Conditions’ Suny 4s De height of the left subtree and atgnt subtrees of A node dilfer ty ak most one. RW) he Left and aqahr subtrees of anode CX exsid) ane alto “pL Trees. he Aerns balan cino Apctos is used to Aelemine wheihea ‘he qven Binary earch Aree % ~~ balanced con nol. The ‘Falanted ations ave ~,0)1 oh ens D Lett Rotation 3) Lehk- Right Rotation 3) Rignt Rotation Wy Right —lett Rotation D beth Rotation 2 O-a “as 1) 8S Rt UNbalantel Lek} Rolotton _Balanted : : - Bal DRY Rotakion | en o. So Be hae “Pe -§ D Bight Leth Rotalion’ Explain abouk Red black tvee and spay keee with example. Red black Aree is Oo Serf ~balanitirg lrnany seardh dree hak has an alte wont Aime of 6 (toqn) fox Insesth, delete and sear opesakions.’ Nhe pwpentter of 'O sypicol ninany Seonch ,~“rvee, A wedeblack ‘twee panes Ane Aettowing propestties & ' ) .Foth , node Xe etitnes pe fo), bloek Wn colbur: | ie es eg ze ‘black Coloured, WD The 00k node nO The adeoh poder ase black coloured, sk tedluda She ‘nul elvidren , » Ww) Whe’ und eee eplouned modes OF ‘black, (eT) O Rea | ° hi a Spay Avge ¢ ° ss Concent e% Spky we ae ‘bated om. athe -AMumpHon ARak when a | “ Pationtass elemenk tattered ' bom a Bnany search jres then tye. ave Vay’ Gnaneer thok the Same ‘ ghement- | would we acceved again “infu | “Now, SE oinNs alement & placed deep in She “ree then all repetitive 5 make or ie eee ebgident 5 ee +yee: the oe oa mode a ws ee os Hiq-2q.q% ' ® é yas NS ®t @) b% Hig- Bgl5 (a) Y) & CG © ae QO ® 3+} Explas xplain about PFs and BFS with example. De pts Yast Seaxchs In Ye depth {ack search, Stortirg yom any Vertis % single rath Po, we groph 6 Motiesel ort) o vertex’ Ye “sfourd whole” abt adjacent vertice how ene arated, as This, proces, continues undt\ alt sthe vertices of graph are vigited.. sThe DRS wer a stack for the Some aml Purpose. Agothyne te Sek vutsrred (vw: true as Bink U 3 Sek eky = ary ~pty + He wht\e ptr) = RULE Th Woted Ertr singoJs tat c Cony depth ~ frst — Search ( thr-sinbe,a7-eh) Else Pls = pty nev 5 Endrt end while End EX | Breadity tyrst Search’s Breadth Yak Seoxch , Stating Som any Vertex, att Ute adjacent vevttter ave tvoaversed. “his process Verte: hae been: Visited. “he BFS Wel ‘A queve at an o Vayu Structuae +0 hola nodes hor d4urtuxe processing: Exe Coninules unk ath the wri- @) ar OF (GS D [ALS: + ccd ieee =e Now quene is empty to stop ABRBFEC sek v=\ a sek vi sited (vJ= Yoe Pant L Vv Lh call 4 ansert (Y) daly det: wolile “is empty = fale CoM delete cy Set pty = ovw-plrav voile C pts ee NvLL) | Sh vista Crete —> inbo] = fae | Colt 4 insert ( Ptr —>"Inhe) ¢ | Sek used (Pty 7 Who) EUS Paint pty —> who End a End white Sek ply py—Snext End witile 6 End He] Elabowake dhe selection sort and tnserdtton Sovt with example, ‘ ' IMSertion ‘Sots Ansekton Sob Is a Gmple Sottn akeoxithm, a CompartSon soyt ty which the Sted Orreary Cor Uist} te bullt one Entnp (ees eh Xm e . 4 Fe ES much ene efictent on large NSC yar Mone advanted abgorthms stv other Sorino _ THREKHOA s 14a Sa) UN Ex8 sot the elements 1619) 4)1, a0, i An sertiwo ‘som Algpribye : J Psoceduse Ins Sort ( AyND }s [Entialize = i=o &- Repeak THRO step oye} TZN Be Mar = ACT pane a? 2 a by Repeat wohiile THO ANS mAKé ALIA-1 a ALAS cere Teo 5 Aisi = man 66 T= THx\ ‘ 4- RETURN: - al Selection sors Selection Sért %$ aA “Simple on tethrique ao Somt a Rtst of elernent! Tn AWE Yind Ahe smatledd tn the ONNouy » Exchang= vk with the ‘irs ¢ element, Aketthm: Sele ekion —Sost ( A, N) Py yp Repeat thru sstep | tow T= ty2)3.- Nay Q Minder = 1, a Repeat yes Jere ton a\ “A Tm andea] > & TI] then oe Minden = J h. 3\ Minder < >i hen A(z] <= ae eal i coe Ge Ee) N : een ay he HY pak ! gale ok, The “overt “blo hu a ACN) —

You might also like