2 TREES A Connected graph that contains no circuit is called a tree. Trees were used as long ago as 1357, n hen n the English mathematician Arthur Cayley used them to count certain types of chemical compounds e that time, trees have been employed to solve problems in a wide verity of disciplines. Trees are particularly useful in computer science Trees are employed to construct eficient algorithms r locating items in a list. They are used to construct networks with the least expensive set of telephone lines ines linking distributed computers. Trees can be used to construct efficient codes for storing and ransmitting data. Irees can model procedures that are carried out using a sequence of decisions. This r nakes trees valuable in study of Computer Science. Definition Tree: A graph G is called a tree if (G is connected (i) G has no cycles. Following graphs are trees Graph is not tree as it contains a cycle b, c, d, b a Similarly is not tree as it contains a disconnected component a b. Remark: From above definition, it follows that a tree has to be a simple graph i.e. having neither a self loop nor parallel edges because both of them from cycle. Note: Tree is said to be directed if every edge of tree is assigned a direction, otherwise tree is undirected. 551 ESTOR: Anceston xcluding the verte SPECTRI DICRETE MAT ertex, excluding, DANT: of a vertex ohe 552 elf and including the roxa ex than roo are the. ven TERMINOLOGY USED IN TREE ndants of a when we discuss tree. we encounter a number of terms that are necessary fo understand ample Descendants of b are d and e eV are thoe tices in the yn from rs DESC ansetni of d ae h vertices tha have SUBTRE consisting « REE: If a is any verex of a and i The terms used are n a tree, the descendants are all edge ibtree wth a as ts incident to these dessendants of b is T(b) as shown In given tig subtree NODE OR VERTEN: Node is key mponent of tree which stores information and can have one o more inks for connecting to other nodes. link, arc or branch EDGE or LINK: A directed line from tree. In above figure ab, ac etc are links. cOREST: A forest is an undirected gaph whose components are all trees one node to other node is called edge, he vertex having indegree zero is called root of tree. In above tree root of tree is a er along the BINARY TREE sa tree. We We say T is n-tree or n-ary tree it every vertex has at most n offsprings. in partiolar, if PATH A Path is a quence of nodes when we traverse from one node to other LEVEL: Level of node is an integer value that measures the distance of a node fror edges then tree iS called binary tree. Let So binary tree is that tree in which every tode can tave 0, I or 2 which connect them e.g. path from a tof is a cJ. rom the root. Root prings. COMPLETE BINARY TREE: ee, if every vertex of 1 is at level 0. The child(s) of root are at level 1 and so on. an leaves, has exactly n-offsprings then we say T is compieste n are at HeIGHT: Height of node is the length of longest path from node to a leat. All the leaves In-tr and height 0. Height of root is height of tree. In above tree. height of d, e, J Is 0, Height of b, cis e. For n=2 we say tree is complete Binary tree. height of a is 2 DEPTH: The depth of node is the length of path from node to root of tree Root has depth 0. In above tree depth of a is 0 depth of b, cis 1. Depth of d e,fis 2. ROOTED TREE : A rooted tree is a directed tree which contains a unique vertex r such thatin degree ofr is zero and every other vertex has in-degree one. The vertex Is called root of too. is a Binary Tree. Example () in- ooted tree. In this example, b is left child of a and c is right child of a. For example. Moreover every vertex (Except leaves) has 2 children so tree is complete Binary Tree is a 3-ary tree. But is not complete. is a rooted tree with root 'a'. PARENT AND OFFSPRING : If (r, y) is any directed edge then x is called parent of y and yis called offspring of x. Root of tree has no parent whereas every other node has A parent can have several offsprings. Offspring is also called child or son. In above tree a is parent of b and c. b has two offsprings d and e. unique parent1. Properties of Tree roof: Since T is a connected graph. Therefore there exists atleast one path between every pair of vertices T. roperty 1. There is one and only one path between every pair of vertices in a tree T. LEAF: A node having no offsprings (outdegree = 0) is called a leaf. In fig. d, e. fare leaves. Leaf is also called external or terminal node. tree wl contain a circuit and then T cannot be a tree. Thus there is one and only path between every pair vertices in a tree T. uppose that between two vertices v and v there exists two distinct paths The union of these two SIBLINGS Two nodes having same parent are called siblings. In figure b, c are siblings of a. INTERIOR NODE : Node having at least one child is called Interior node. 4. A graph is a tree and let the graph ected. Then sPT TRI M DiSC RETE MAL EMATIC only if it is minimally perty 4 ; Firstly 554 then G is tree Connec ted it which plies that T is be a tree eretore T must be a e there must exists an roperty 2. If m a graph G, there is one and only one path between every pair of vernice conn S Froof: Since there is one and onh one path between every pair of vertices in u implics that G i. edge e, in T such t a tree, a contradiction connected aph if po ch that T- e, 1s Hence I must be minimal graph Suppose that i contain a ciruit, then there is atleast one pair ot vertices 'i. V; (Say) such tCteg h that there aph If possible e circun a minima connected graph Ther f the edge in the circuit and still eave the gaph conin have circuit Let T be gsersely. one of Wence G MO distinct path between them A contradiction to the given fact and s IS a connect graph w ithout cincuit implies that G is a tree onnected. Therelore e hereiore e,is in nimally conneted efore T cannot have a A graph G with n vertices and (n a circut otherwise we Hence T s a Tee nove Property AA tree with vertices has I edges ist a graph G with n vertices, (n-1) edges ) edges and no circuit nperty 5 it 15 connected l consists of two nfs G and G; as shown below wo or more circuit-les edees and no Cireut which is disconmeced. Then G less component. Without loss of generality, let G consis root. We shall prove the result by induction on the number of veruee ol: Let there e Obviousl the result is true for n-1. 2, 3 as Zero edge niponents G When 1 we have When - One edge we have When n3 V Two cdge. we have tween the vertices v, in G, and v, and G Since Now, add an edge. hy adding an edge e did not create a cirCuit in u. Ihus e s a circut less conDected graph th between v, and v, except en Eive different but equivalent definition of tree are A graph G with n verices is caled a tree if Since there S o ath between u, and e in other words, a tree has Let us assume that the result is true for all tree with less than n vertices. n vertices an n edges. which is not possibie Hence a graph only one path between every pair of vertices ie., there is no other path between v, and v, excent Therefore deletion of edge from T will disconnect the graph as shown below. consider a tree T withn vertices. Let e be an edge with end verities t, and v,. Since there js one and ices and (n - I) edges and no circut is connected. Remark (0 Gis connected and has no circuit. () G is connected and has (7 - 1) edges (i G has n- I edges and no circuit. there is exactly one path between every pair of vertices inG ()G is minimally connected. Therefore T-e, consist of exactly two component T, and T; (say). Since there is no circuits in T en. In any non-"TV1dl tree, there are atleast two pendent vert of these components is a tree. Further, both of these tree Ti and T2 have less then n-vertices, therefore hu supposition, each tree will contain edge one less then the number of vertices in it. So l- e consist of (n- cdges implies that T has exactly (n -2)+1 = n-1 edges. This completes the induction. Note It may be noted that the vertices of a tree are connected together wIth the minimum number of proof : Let I be a non-rivial tree with n vertices, then T has -1 edges. edges Or In any non-trivial tree, there are at least two vertices of degree 1 By fundamental theorem on graph theoy Definition. Minimally connected graph: deg (,)-2 (n-1)= 2n2 .) A connected graph G is said to be minimally connected if removal of any edge from it disconnect the graph. if possible, let T contain only one vertex (say) U of degree l1. Then For Example: deg (v) =| and deg (v,) 22 for i2.3,4, deg (v)- deg ("1)> deg (,) i2 =I+deg (0) 2 1+2(m -1)-2n-1 are minimally connected graphs. i2 556 SPECTRM DISCRETE MATH EMATICS mple 4. Con List all level-3 vertice ole 4. Consider the t tree. From () and (2), we get 22m - 1, a contradiction. must have more than one vertex of degree 1 i.. 1has atleast two vertices of degree (a) leaves. 551 Eampe : Which of follow ing graphs are trees )List al MVAXT c) What are siblings of d? (d Draw the () What is level and height of m? Rot of tree is a. So level ofa =0 Tree T(b). ol At level one we have b, C two we have e, h, i. j, k, I at level three we have f. g and m. d ( at leve vertices that have no offsprings. In given tree leaves are f. z, h, i. j, n and l. (6) Leaves SoL (a) Number of vertices = 6 Siblings of dare b and c b. c, d have same Number of edges = S as edges = n-1 and graph has no cycle so it represent a tree. (Tree T(b) is as show (6) Sance graph contains two disconnected components so it is not a tree. (c) Number of vertices =6 Number of edges = 5 as edges = n-1 and graph has no cycle so it represent a tree. (d Graph contains a cycle so it is not a tree. (e) Graph is a tree it contains no cycle and number of edges (6) = number of vertices (7)-1 (e) Level of m =3 Height of m =3 +| =4 (Height = level - 1) Graph is not tree as it contains a cycle. Example 2. Let A = {a b, c d e} R = {(a. d). (b, c). (c, a). (4 e)} check whether R is a tree. If it is, find the root. Sol We are given five vertices and four edges. R will from tree iff 2.3. Labeled Trees ) cdges connect all vertices (i) edges will not form cycle among vertices. From R, it is clear "b' has indegree 0. If R is tree then b must be root. So taking b as root we construct all edges as below Definition: A Tree is said to be labeled in which every vertex of Tree has aigned a unique label. Labeled tree is usually used to construct expression Tree. Any algebric expression can be represented with the help of labeled binary tree. For this root of tree is labeled with the central operator of main expression. The two offsprings of root are labeled with central operator of expresion for left and right arguments respectively. If either argument is a constant or variable (instead of expression), this is used to label the corresponding offspring vertex. This process continues until expression is exhausted Example 5. Construct the tree of algebraic expression. )3 r +(6 x (4 + (2-3) 3 As no cycle is formed, so R is a tree and b is root of tree. Example 3. Prove that A= {1,2,3, 4, 5, 6} R= {(1, 1), (2, 1), (2, 3), (3, 4), (4, 5), (4, 6)} is not a tree. Sol. As number of vertices =6 and number of edges = 6. So R cannot be a tree. 6 in tree no. of edges = n-1, n = no. of vertices. srECTRUM DISCREIE MAI ww.MATICS (1) Traverse the left (2) Process the root R S58 subtre of R in inorder. Inorder: () (7 (6-2)-(r - (-4) (3) Traverse the right subtree of R 559 in inorder subtree of R in postor (2Traverse the right subtree of R in postorder ler: (1) Traverse the left Post order (3) Process the root R rse the following Tree in Preorder, Post order and inorder Traverse the jrample ; s Preord eorder Traversal : A, B, D, E, C, F (i) (2 x y)Sa - b This expression is equivalent to (2 x x)+ 1) x (5 x a) - b) Exponent is represented by symbol t qstorder Traversal: D, E, B, F, C, A Inorder Traversal: D, B, E, A, C,F. arch the following Tree in pre-order, post-order and in-order. 8. Search the f ample 3 k g Sol. Pre-order Searching: For pre-order first we process root then left subtree in preorder and then right Example 6. Draw a binary tree to represent (2-(3x x)) + (t-3)-2 +r). Subtree in pre-order. Result is Sol. a, b, c, g, h, i, d, k, e.j ,s In-order Searching: For in-order first we traverse left subtree in inorder, then we proces rost and atleast we process right subtree in order. Result is g. c h, b, i, a, k, d. j, e, f Post-order Searching : For post-order first we traverse left subtree in post-order. then we traverse right subtree in post-order and last we process root. Result is : 8h, c, i, b, k, j. f. e, d a. 2.4. Traversal of Binary Trees or Tree Searching Polish Notations : An expression tree has three forms Traversing means to visit each node of tree exactly once. There are three standard ways of traversng a binary tree T with Root R. These algorithms are called preorder, inorder and post order traversals and are as follows Preorder rrenx Form : When a pre-order traversal is performed on an expression tree then result obtained is called pre-fix form or Polish form of the given algebraic expression. rOst Fix Form: When a post-order traversal is performed on an expression tree then result 2. ained is called post-fix (1) Process the root R. (2) Traverse the left subtree of R in preorder. form or reverse polish form of the given algebraic expression. 1nfix Form Infix form results from the in-order traversal of expression tree 3.1 3) Traverse the right subtree of R in preorder. pmple 12,, pre-order*+ 2. Construct a tree whose pre-order and in-order traversal is giv sPECTRUM DISCRETE MATHEMAT ATUEMATICS .+4xyt S60 5a b 6 given below 561 Consider the expression a In this expression a, b are operands and + is an operator The der (4x * y) * (5 a-b) t 6 In-orde Seyuenee of operators and operands in three form is as given beow Pre-fix form operator, operand, operand Post-fix form: operand. operand, operator In-fix form operand. operator, operand. traversal. In this first element i construct tree st we see pre-order traversal. Left of * ie. 4 x+ will repeat until whole of tree has been con foee the position in In-order come right s tree formed is shown below This process nich become root of tree. ubtree. become left subtree i hen We see the 5 a-b) 6 .Find pre-fix and post-fix expression for (( +y) t 2)+ (* - yY3) Sol. The expression tree of above expression is show below constructed. The a 5 To find pre-fix form of given expression, we traverse the tree in pre-order. Result is : tr y2/- x y3. ation of Prefix Expression (Polish Expression) Post-tix form of expression is given by traversing the expression tree in post order. Result is y+2t xy-3 proced allowing steps are used to evaluateP adure: Let P be given pre-fix expression. Let S denotes binary arithmetic operator (, -,*,, t). Example 10. Represent the expression (A + B) (C-D) as a binary tree and write prefix form expression. Traverse P from left to nght until we find a string of the form Sry, where r and y are mumbers (operands). rm of 1. 2. Evaluate xSy. Substitute the result of rSy for the string Sry. 4 Continue the procedure until only one number remains. ample 13. Evaluate the pre-fix expression 2 3 512 34. The step by step procedure to evaluate above expression is shown in following figure. SolL The Binary Tree corresponding to expression is shown below Step 1 /t 234 D Prefix form:*, +, A, B, -, C, D. Step 2 -6 5]t23 4 6-5 1 Example 11. Consider the completely parenthesized algebraic expression (a-b) x (e + (d+ e)). Find its preorder, post order and inorder search. Sol. First we draw expression tree corresponding to given algebraic expression which is shown below: Step 3: 1 /t 2 34 2t3 8 Step 4 +18 4 8/4= Step 5: t b Value of expression = 3. 4D. Evaluation of Post fix Expression (Reverse Polish Expression) Procedure: Let P be given post-fix expression. Let S denotes binary arithmetic operator ( ) Preorder Search: X,-,a, b, t , c, +, d, e. Postorder Search: a, b, cc d e, +, +, X averse P from left to right until we find a string of the form x y S, where x and y are numbers. operands). Inorder Search a-,b, x, c, +, d, +, e. SPECTRUM DISRETE MAT EMATICS 562 is a connected graph Clearly it is not a tree. S63 for exampe 2Evaluaie iSv. Replace string uS by result ot S Contne the procedurr until onty one nurmber remains Example 14. What is the value of post-fir eyresso spanning tree of G is 723 StcP provedure to evaluate above expression is shown in tollowing figure: Step 7E aanning tree of graph is not unique 4 3 4 (inimal Spanning Tree: ning tree of a weighted graph is a spanning tree with the condition that sum of weights Step 2 as small as possible. 7-6-1 Step 3 L It4-1 or example : Given weighted grap Step 4 93 3 Step L I3- Value of expression =4 Minimal spanning tree of this graph is Example 15. Is their a binary tree with height 6 and 65 leaves? Sol Height of Tree =6 So maximum number of levels = 6 - 1 (level = height - 1) =F5 we know, maximum number of leaves in a Binary Tree = 2", wherer is level. So maximum number of leaves 2 32 Therefore. binary tree with height 6 and 65 leaves is not possible. Eaample 16. A tree withn vertices has at least two vertices of degree 1. (n 2 2) Weight of minimal spanning Tree = 3 +4 +6 13. Maximal Spanning Tree: A maximal spanning tree of a weighted graph is a spanning tree with the ndition that sum of weights of tree is as large as possible. For example: Given weighted graph Sol. Given tree T hasn vertices So number of edges in T =n-1 Let us suppose T has no vertex of degree =1| We know, total degree 2 x number of edges = 2 (n -1). So degree of each vertex = -2 - <s 6 either degree of vertex is I or 0. Maximal spanning tree of this graph is But T can not havea vertex of degree zero. So our supposition is wrong. T must have at least two vertices of degree= 1. Example 17. How many edges does a tree with 10,000 vertices have ? Sol. Number of vertices = 10000 We know number of edges = n - 1 = 10,000 1 = 9999. Spanning Tree Let G be a connected graph. A subgraph T of G is called a spanning tree if () T is a tree. (in T contains all vertices of G. Weight of maximal spanning tree = 7 +6+4= 17. ing tree contains; all vertices of graph. So number SPECTRUM DICREE MATHE 1UEMATIS 564 AS We are given 5 ed af ways for removing 2 edges C = 10 ways. S65 we know spannino neans we have to r edges taken 7. A graph G is connected if and only if has a spanning tre* 2.7 are given 5 edges which emove 2 edges. 4-13. P'roof: Firstly, let the graph G be connected Let k be the nunmber of cireunts (or cycles) in G We apply duction on &. Ifk - 0, then G has no circuit also, G is connecc Gis a tree and so has a spanning tree mOval of edges should not disconnect graph. then graph is disconnected. Similarly removal of eg.e Tesult in disconnected The result is true for å 0 If we remove Une result is true for all connected graphs with less than k cycle LeGbe a connected graph with k circuits. Let e be an edge im one or ne circuits, then connected graph havng fewer edges than G. there are 8 p 8 possible spanning trees of given graph. Ge is indu hypothesis G-e has a spanning tree. But G-e has all the vertices of G. These are By he spanning tree of G- e is also a spanning tree for u. The result is true for G also. Hence the result folows by induction. is a oversely: Let the graph G has a spanning tree T (say). We show that 1s connected. Since Panng ree of G. Therefore there exists a path between any pair of vertices in & along the tree T. G is connected. mark.(Cayley's Theorem) The complete graph K, has ndifferent spanning tree. For example: There are i6 spanning trees of K. These are as shown be low Kruskal's Algorithm (To find minimal: spanning tree) Let Che the given connected graph with n vertices. Then Kruskal Algorithm to find minimal aning tree involves following ste Write all the edges of graph in increasing order of their weight. XXXX 2. Select the smallest edge of G. For each successive step select another smallest edge of G which makes no cycle with previously elected edges. 4.Go on repeating step 3 until n-1 edges have been selected. The sum of weights of these n-1 edges ill constitute required minimal spanning tree. vample 19. Find the minimal spanning tree of weighted graph using Kruskal's algorithm B NN D Example 18. How many spanning trees the graph have ? Draw all spanning trees of graph. ol. Number of vertices (n)=5 3 First we write all edges in increasing order of weight E= {CD, BD, CE, AB, BC, AD, AE, DE, AC) CStart from edge CD and then select edges one by one from E until we select 4 edges (n-. Select next edge bd and then ce. 2 S66 SPECTRUM DISCRETE MATUEMATI 561 D a (i) Select next edge ab 2 (i) Select next edge BD (i) Select next edge CE Select next edge ef () () Select next edge AB a Select next edge gh D 2 d Since we have 5 vertices and we have selected 4 edges, so we stop algorithm. Minimal spanning tree is as shown and sum of weights is I +2+2+3 = 8. Example 20. Find the minimal spanning tree for the following weighted connected graph using Kruskal's Algorithm. C a (vi) Select next edge eh 2 Sol. First we write all edges in Increasing order of weight E -ac, bd ce, ab, cd be, ef. gh, ed, eh. Je} Number of vertices (i) -8 We start from edge ac and then select edges one by one from E until we select 7 edges (n-1) As we have selected 7 edges, so we stop algorithm. Minimal spanning tree is as shown and surm or weights is () a 2 2+2+2+3+4+4+5 =22. 568 rest neighbour of {A, B, D, C} is E. nsert S69 SPECTRUM DISCRETE MATIEMATICS E 2.9. Prim's Algorithm to Find Minimal Spanning Tre (p) Next nearest Let & be the given graph with n vertices. Then Prim's s algorthm to nna minimal spannin involves following steps ning ree .Choose any vertex V of G or start trom given vene Connect V, to its nearest neighbour say V aking ("i. t) as one subgraph connect this subgraph to its nearest neignbour Le. vertex whi tices are 5 and we have connected 5 vertices using 4 edges so we stop algorithm. nich S o Vi or V. Let this vertex is V The new vertex must not fom a cycte win prevIOus added vertices Shtof weights is1+2+ mple 22. Find minimal As number of vertic fweights isIt 2+2+ 3 = 8 o on repeating step 3 until all n vertices have been connected by n-l edges. he sum of wei. ot these n-l edges will constitute required minimal spanning rec nal spanning tree for the following weighted connected graph using Prim's e. Xample 21. Find minimal spanning tree of weighted graph using Prim s algorithm. rithm by starting a 2 5ol. ol. We start from given vertex e. Sol. Let us start from vertex A. ( Nearest neighbour of e is c. Insert e c. ( Nearest neighbour of A is B. Insert AB (i) Next nearest neighbour of {e, c} is a. Insert ca. (i) Next nearest neighbour of {A. B} is D. Insert BD. (i) Next nearest neighbour of {e, c, a} is d. Insert c d d C (iii) Next nearest neighbour of {A, B, D} is C. Insert CD a () Next nearest neighbour of {e, c, a, d} is b. Insertbd. b 570 sPECTRUM DIsCRETE MATH 571 Next nearest neightur of ie ad A} is y. Inse MATIC ne Such spanning tree is: D w Next nearest neighbour of fe. c a d b. f} is h. Insert e n pampl nle 24. Generate a spanning tree for A (van) Next nearest neighbour of te. ca d .f. h} is g. Insert h8 2 Sol. Number of edges in graph = 7 Number of vertices in graph = 6 (n) For spanning tree we need n - 1 edges i.e. 6 - 1 5 edges that must be connected in such a way so that graph must be connected without cycle. As number of vertices are 8 and we have connected 8 vertices using 7 edges, so we stop algorithm. One such spanning tree is Sum of weights is 2 3 2+2 +4 +4 + 5 =22. Example 23. Generate a spanning tree for the graph EXERCISE 2.1 Draw all the trees consisting of Sol. Number of edges in graph 7 (6) Two vertices (a) One vertex (c) Three vertices (d) Four vertices Number of vertices in graph (n) = 5 )Six vertices. fT,= (V1, E), T2 = (V2, E) be two trees where | E,= 17 and|V,|=2|V1. Find | V.IVal and | E|. (e) Five vertices For spanning tree we need n - I edges ie 5 - 1 = 4 edges that must be connected in such a way so that graph must be connected without cycle. SIf F =(V1, E,) be forest of 7 trees where E,| = 40 then what is |V, 1? 572 573 (V;. E e forest with V-6 and |E51, how many trees detemmine F, ? Gi SPECTRUM DISCREIE MATEMATICS Draw aw all rooted tree with 5 nodes. 5. Cxample of an undirected graph G V, E). where | E V , but G is not a binary tree with 4 leaves PTove that in any non-trivial tree there is atleast onc vertex of degree1. 14. Draw all binary tree aiskal algorithm to find spanning tree of minimal weight by showing each step. 8. Draw all binary binary tree with 6 leaves. a ree Answer the following questions for the tree shown below (a) Which vertices are the leaves Use 5. B (c)Which vertices have level number 4 (b) Which vertices is the root () What is the height of the tree 8. On the first Sunday of 1993 Ram and Shyam start a chain letter, each ot them sending 3 lettere Each person receiving the letter is to send 3 copies to 3 new people on the Sunday followino etter's arrival. After the first five Sundays have passed, what is the total number of chain let that have been mailed ? How many were mailed on the last Sunday. 9. Find all spanning trees of the graph t6 Find minimal spanning tree of above problem using Prim's algorithm by starting from D. 17. Find minimal spanning tree of weighted graph shown below A B etters D 10. Find the number of spanning trees of the figure given below. 18. Show that maximum number of vertices in a binary tree of height n is 2" - 1. 19. Prove that largest number of leaves in an n-tree of height k is n*. 20. Construct expression tree of following (a) +y) + (x * 3)- (z + 4) (b) ((2 x x)+(3 - (4 x x))+ (x - (3 x 11)D 11. Find a minimal spanning tree for the connected weighed graph given below using both Kruskal's and Prim's algorithm. (c)(((2 x 7) +x) + y) + (3- 11). 21. Evaluate the expressions given in polish notation (a)x +3 4 7 2 12 x 3 6 4 (6) - x 3 xx 4 y + 15 x 2- 6 y where x is 2 and y is 3. L. Evaluate the expression given in reverse polish notation 10 7XX y - 8 x X w + X where x is 7, y is 2 and w is 10 43. What do you mean by Tree Searching? Discuss various algorithms for searching the trees? 575 S74 sPECTRUM DISCRE TE MATUEMATICS EES (a) The vertices J, h, K, P, 9, 3, t are the leaves 24. Define a Minimum spanning e of a graph and find the same for the graph. (b) The vertex a is the root (c) The vertices k, P, 9, 5, t are at level 4 ()The height ofthe tree is 4 363,2 243 8. V ANSWERS 1. ( One vertex () Two vertices 10. (i Three vertices E ()Four vertices Y (v)Five vertices 11. ****. YYYX (vi) Six vertices 2 18, 36, 35 3. 47 4. 11 HEMATK SPECTRUM DISCRETE MATHE. 576 12 AA 13. 14 24. 40