1. Which of th grphs r trs? c f c g f c x y f z p q r 1
1. Which of th grphs r trs? c f c g f c x y f z p q r
. Answr th qustions out th following tr 1) Which vrtx is th root of c th tr? ) wht is th hight of th f g h i j k m tr? 3) Which vrtics r n o p q r s chilrn of h? t u v 4) Which vrtics r silings w x y of n? z 5) Wht vrtics r intrnl? 6) Which vrtics r lvs? 7) Which vrtx is prnt of u? 8) Which vrtics r ncstors of t? 9) Which vrtics r scnnts of f? 10) wht vrtics r t lvl 3? 3 11) Is th tr lnc?
. Answr th qustions out th following tr 1) Which vrtx is th root of c th tr? ) wht is th hight of th f g h i j k m tr? 4 3) Which vrtics r n o p q r s chilrn of h? non t u v 4) Which vrtics r silings w x y of n? 0 n p z 5) Wht vrtics r intrnl?,, c,,, f, I, j, m, n, q. 6) Which vrtics r lvs? g, h, k, o, p, r, s, t, u, v, w, x, y, z,, 7) Which vrtx is prnt of u? m 8) Which vrtics r ncstors of t? m,, 9) Which vrtics r scnnts of f? n, o, p, w, x 4 10) wht vrtics r t lvl 3? n, o, p, q, r, s, t, u, v 11) Is th tr lnc? No, cus w hv lvs t lvls,3,n 4
3. Dtrmin which trs r full, complt, or nithr. f c g c T 1 T h f g T 3 5 T 4 T 5
3. Dtrmin which trs r full, complt, or nithr. c f g c nithr T h nithr 1 T f g T 3 full T 4 complt T 5 complt 6
4. ) How mny nonisomorphic root trs r thr with fiv vrtics? ) How mny nonisomorphic unroot trs r thr with fiv vrtics? 7
4. ) How mny nonisomorphic unroot trs r thr with fiv vrtics? vrtics of gr 1, n 3 vrtics of gr 3 vrtics of gr 1, 1 vrtx of gr, n 1 vrtx of gr 3 4 vrtics of gr 1, n 1 vrtx of gr 4 Answr: 3 trs 8
Answr: 9 trs CSI35 Chptr 11 Rviw 4. ) How mny nonisomorphic unroot trs r thr with fiv vrtics? vrtics of gr 1, n 3 vrtics of gr 3 vrtics of gr 1, 1 vrtx of gr, n 1 vrtx of gr 3 4 vrtics of gr 1, n 1 vrtx of gr 4 ) How mny nonisomorphic root trs r thr with fiv vrtics? 9
5. ) How mny gs os tr with 80 vrtics hv? ) How mny intrnl vrtics os full inry 3-ry tr with 113 lvs hv? c) How mny vrtics os complt 4-ry tr of hight 6 hv? 10
5. ) How mny gs os tr with 80 vrtics hv? A tr with n vrtics hs n-1 gs, hnc th givn tr hs 79 gs. Answr: 79 gs ) How mny intrnl vrtics os full inry 3-ry tr with 113 lvs hv? m = 3, l = 113, hnc i= l 1 m 1 =113 1 3 1 =11 =56 Answr: 56 intrnl vrtics c) How mny vrtics os complt 4-ry tr of hight 6 hv? lvl 0: 1 vrtx 4 0 lvl 1: 4 vrtics 1*4 = 4 1... lvl : 4 vrtics 1*4 1 = 4 4 6 Answr: 1 + 4 + 4 + 4 3 + 4 4 + 4 5 + 4 6 vrtics. 11
6. Givn inry tr (s low), insrt th following numrs, on y on: 10, 14, 66, 79, n 37. 45 6 76 65 89 53 70 1
6. Givn inry tr (s low), insrt th following numrs, on y on: 10, 14, 66, 79, n 37. 45 10 6 37 76 65 89 14 53 70 79 66 13
7. How mny wighings of lnc scl r n to fin countrfit coin mong four coins if th countrfit coin cn ithr hvir or lightr thn th othrs? 14
7. How mny wighings of lnc scl r n to fin countrfit coin mong four coins if th countrfit coin cn ithr hvir or lightr thn th othrs? Dscri n lgorithm. Answr: 3 wighings. Th lgorithm: x 1,x : x 3,x 4 x 1,x lightr x 3,x 4 lightr x 1 : x x 3 : x 4 x 1 lightr sm x lightr x 3 l x 4 lightr sm x 1 x 1 : x 3 x x 3 x 1 : x 3 x 4 sm not lnc sm not lnc 15 x 4 x 3 x x 1
8. Construct th inry tr with prfix cos rprsnting ths coing schms: : 1 : 01 c: 001 : 0001 : 00001 16
8. Construct th inry tr with prfix cos rprsnting ths coing schms: : 1 : 01 c: 001 : 0001 : 00001 0 0 1 0 1 0 c 1 1 1 A vrition of qustion: trmin which of th givn cos 17 r prfix cos.
9. Us Huffmn coing to nco th symols with th givn frquncis. : 0.4 : 0. c: 0.1 : 0.15 : 0.13 f: 0.0 18
9. Us Huffmn coing to nco th symols with th givn frquncis. : 0.4 : 0. c: 0.1 : 0.15 : 0.13 f: 0.0 0.0 f 0.1 c 0.13 0.15 0. 0.4 Initil stp 0.1 0 1 c f 0.15 0. 0.13 0.15 0.5 0 1 0 1 c f 0. 0.4 0.4 1 st itrtion n itrtion 19
9. Us Huffmn coing to nco th symols with th givn frquncis. : 0.4 : 0. c: 0.1 : 0.15 : 0.13 f: 0.0 0.5 0.35 0.4 0 1 0 1 0 1 c f 0.6 1 0.4 0 0 1 0 1 0 1 c f 4 th itrtion 3 r itrtion 0
9. Us Huffmn coing to nco th symols with th givn frquncis. : 0.4 : 0. c: 0.1 : 0.15 : 0.13 f: 0.0 0 1 0 0 1 c 5 th itrtion 1 0 1 1 0 1 f prfix co: : 1 : 000 c: 0110 : 001 : 010 f: 0111 Th vrg numr of its rquir to nco symol is: 0.4*1 + 0.*3 + 0.1*4 + 0.15*3 + 1 0.13*3 + 0.0*4 =.3
10. List th vrtics of th tr visit uring ) prorr trvrsl ) inorr trvrsl c) postorr trvrsl of th tr. c f g h i j k m n
10. List th vrtics of th tr visit uring ) prorr trvrsl ) inorr trvrsl c) postorr trvrsl of th tr. c f g h i j prorr trvrsl:,,, k, m, f, c, g, h,, i, n, j inorr trvrsl: k,, m,, f,, g, c, h, n, i,, j postorr trvrsl: k, m,, f,, g, h, c, n, i, j,, k m n 3
10. Rprsnt (A B) (A (B A)) using n orr root tr. Thn writ th xprssion in prfix, postfix n infix nottions. 4
10. Rprsnt (A B) (A (B A)) using n orr root tr. Thn writ th xprssion in prfix, postfix n infix nottions. A B A prfix : A B A B A postfix: A B A B A infix: (A B) (A (B A)) B A 5
11. Evlut th prfix xprssion + - ^ 3 ^ 3 / 6 4. 6
11. Evlut th prfix xprssion + - ^ 3 ^ 3 / 6 4. + - ^ 3 ^ 3 / 6 4 4-= + - ^ 3 ^ 3 / 6 6/ = 3 + - ^ 3 ^ 3 3 3 = 8 + - ^ 3 8 3 3 = 9 + - 9 8 3 9 8 = 1 + 1 3 1 + 3 = 4 + - ^ 3 ^ 3 / 6 4 = 4 7
1. Us pth-first-srch (DFS) lgorithm to prouc spnning tr for th givn simpl grph. Us vrtx s th root of th spnning tr. c g h q n f i j k m p o 8
1. Us pth-first-srch (DFS) lgorithm to prouc spnning tr for th givn simpl grph. Us vrtx s th root of th spnning tr. c g h q n f i j k m p o 9
1. Us pth-first-srch (DFS) lgorithm to prouc spnning tr for th givn simpl grph. Us vrtx s th root of th spnning tr. c g h q n f i j k m p o 30
13. Us rth-first-srch (BFS) lgorithm to prouc spnning tr for th givn simpl grph. Us vrtx s th root of th spnning tr. c g h q n f i j k m p o 31
13. Us rth-first-srch (BFS) lgorithm to prouc spnning tr for th givn simpl grph. Us vrtx s th root of th spnning tr. c g h q n i j k f L = {,, c,,, f, i, g, h, j, k, q, m, n, o, p} m p o 3
13. Us rth-first-srch (BFS) lgorithm to prouc spnning tr for th givn simpl grph. Us vrtx s th root of th spnning tr. c g h q n i j k f L = {,, c,,, f, i, g, h, j, k, q, m, n, o, p} m p o 33
14. Us Prim's or Kruskl's lgorithms to fin minimum spnning tr for th givn wight grph. 1 c 1 1 i 3 n 3 3 f 3 g 3 4 3 j 4 k 3 4 3 o p 3 m 1 h 3 q 34
14. Us Prim's or Kruskl's lgorithms to fin minimum spnning tr for th givn wight grph. 1 c 1 1 i 3 n 3 3 f 3 g 3 4 3 j 4 k 3 4 3 o p 3 m 1 h 3 q 35
14. Us Prim's or Kruskl's lgorithms to fin minimum spnning tr for th givn wight grph. 1 c 1 1 1 g f h i 3 j k 3 m n o p q 36