Oval: aQuestion 2 (a) : BFS

You are only supposed to show the

black nodes.

 

 

 

 

 

 

 

 

 

 

(i)                                                                                                                                                                  (ii)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(ii)                                                                                                                                                                (iv)

 

 

 

 

 

 

 

 

 

 

 

 

 


(v)                                                                                                                                                                                        (v)

 

 

 

 

 

 

 

 

 

 

 

 

 


(vi)                                                                                                                                                                                      (vii)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


(viii)

 

Question 3(b) : DFS

Oval: a
1/
 

 

 

 

 

 

 

 

 

 

 


(i)                                                                                                                                                                  (ii)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


            (iii)                                                                               (iv)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


                (v)                                                                                                                           (vi)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


            (vii)                                                                                          (viii)

 

 

 

 

 

 

 

 

 

 

 

 

 

 


            (ix)                                                                                           (x)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


                (xi)                                                                                                                           (xii)

 

 

 

 

 

 

 

 

 

 

 

 

 

 


            (xiii)                                                                              (xiv)

Question 3 (C) : Prim’s Algorithm

 

 

 

 

 

 

 

 

 

 

 

 


2

 

 

 


4

 

 

 

 

 

 

 

 

 

 

 

 

 


4

 

4

 

 

 

 

 

 

 

 


6

 

 


4

 

 

 

 

 

 

Total Weight of the MST = 1+2+4+7+20+25+6 = 65