reset password
Author Message
nahmed5
Posts: 57
Posted 11:41 Jul 16, 2015 |

Hi,

Some students asked me how to solve Q#6 of Quiz on Chapter#22.

Well, you need to notice the order in the adjacency list to solve the problem, especially

adj(s) = [a, c, d]     and    adj(c) = [e , b]

So, for (a) BFS: s -> a -> c->d->e->b

and for (b) DFS: s -> a -> c->e->b->d

according to the adjacency list.

There's a little trick in this question. But, most of the students got partial marks if attempted.