Binary search tree implementation (insertion,searching,deletion,inorder printing), Assignments of Data Structures and Algorithms

This is an assignment of BST implementation, which clarifies the core of searching , insertion and delerion operations, with an vital feature to find duplicates in bst and printing bst with inorder traversal with count of duplicates.

Typology: Assignments

2025/2026

Uploaded on 12/20/2025

24p-0756-muhammad-faseeh
24p-0756-muhammad-faseeh 🇵🇰

1 document

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Binary search tree implementation (insertion,searching,deletion,inorder printing) and more Assignments Data Structures and Algorithms in PDF only on Docsity!

Discrete Structures Assignment # 3 Name: Zehra Ahmad Roll no: 24P-3045 Class: SE-3A . 3 h ‘ d k Fig (a) Chromotic Number of Crvophs Gi eal mee a a tg hig k Color Red Ble => 40, CN=2 Foyt) : < - A Qroph has 1000 vertices & 4 ealge vertices - So only 4 paive of Cpe is connected yyheyeas thee ove 998 isdoted vertices. . » The isolated vertices can be: of andy coli and we need ony Q colors for each eonnected verbir- - Hence the CN is Q- Part (6) “A cwouloy goph hase 199 chovdo porolel to eachesther. + Each of the 199 parallel chords har 2 end points. > 199K 2 = 399 vertices. » These 298 points divide the circle j edges and civle into 398 boundoy 199 chord edges. > 3984499 = 547 EAL edges. Question: 2 Poyt :O * Ke > 6 vertices Paxt:b go *Egdes exist if tb dbits differ by 1 bit. *Q3 > vertices Pout :¢ Cy > Vertices = 4 . Edges: ed (i=2) , e2(2-3) 9 @3C 3-4) , e4(4- 15 a a_b d. 1) Minimum oo Fe AO DMP HM KP DO sO Stat} Q « o% © oD co oo 0 Poth: a | Q Yo B20 2. SO oO oie? A>Cad%e%g 2D QO “oa 306 Wee 2 s eaqasanieage Q Yo 30 6 Ic oe 22 © oo © b di O “a da 6¢ Te lid 0} 0 Ya 3a be Td Ild Ire £1 0 4a 3a 6c Wd Id Ie 18F 9] 0 4a 3a 6c Td Id Ie 16g v 0 Ya 30a 6c Td Id Qe 6g | Quecion ‘ be Port a: a b ra 2 Cieubod Grroph © a Port b: > Dame as Question 4, Port C: Vertices = 348 Edges = 597 Poxtc: > Question 1, Fort d: Question:6 j ry A a Prim’s Algorithm :- i 4 Edges | Cost “ Co,d)) = : (a.e)) 2 Got ag Gayl & 2 MSt— (a,b) Be Toto = © b. Kruskal's Algorithen = = Edge | ok \ | Cea 4 (o,e)) + (e,d)] 2 (a,e) y | Totol = 6 “Cone 4s > La Tricktker , Y = Wicker. =. X+V Yr = TVT = True - ~ Again Contradiction » Stokement InVabid- Hence, From Core D: : X he Soge and Y i a lrvickstey. Question .@ ats oes Todo isidouy = uF The weother is bod = W 1 will not teach ducrete = ~T Inverse: GE VW) W 2 P28 a) Converse: [> PJ T > (FAnwW) b) Contoypositive (~Q> ~P} ARVO ST > (“FN WD) cy Implicakions p(P>@ > ~CP) > ~Co] CFAwW) >T Question:4 P= A ina knight + P= A is a knove QeBpaknight » ~Q=B8 is a knove R=Cira knight , ~R=-C% a knowe "A Says rP VQ. + Boos QeP -C gays YR r Folse rlrue = Knight (K) » Mome (ND AM B@ICR) ~Pva QeP oR Ki ke T F 21 Kak | Ne ai 4; 31K N| Kk F % = “IK | N N ¥ F a s| Na ey Ay is F cl Ny we CE F 35 IN| NK] T a: ia BIN IN IN| T aE + > Row 9,6,7,8 bhoew A= knoue > Row 5.6/9.8 shew B . : ov Knowe ( fannie pee Mngt