[SOLVED] CSC6013 Week 3 Worksheet

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Module-3-qud5ew.zip (492.6 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

BFS – Breadth First Search using the brute force algorithm as seem in class
Consider the graph below:

1) Represent this graph using adjacency lists. Arrange the neighbors of each vertex in alphabetical order.
– list the triplets for this graph in the form (A, B, 1), where there is a edge from vertex A to vertex B;
– Note that this graph is directed, unlike the one presented in class.
2) Trace the BFS execution by adapting the code to deal with a directed graph (remove lines 14, 15, and 16) and instrumenting it to print every time a vertex is visited and everytime a vertex is enqueued or dequeued.
– Each time a vertex A is visited print: “Vertex A visited” and the current array V;
– Each time a vertex B is enqueued print: “Vertex B enqueued” and the current queue Q;
– Each time a vertex C is dequeued print: “Vertex C enqueued” and the current queue Q.

  • Module-3-qud5ew.zip