Question: CS3353 Data Structures and Algorithm Analysis I Programming Assignment - may be written in c, c++, or java Implement the BFS (Breadth First Search) algorithm.

CS3353

Data Structures and Algorithm Analysis I Programming Assignment - may be written in c, c++, or java Implement the BFS (Breadth First Search) algorithm. Input: take an input graph (directed acyclic graph) in the form of adjacency matrix. 1 0 1 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 (*notice that the values are arbitrary, just refer to the format) Output: record and maintain the information of vertices and edges in the adjacency matrix in which each coordinate should contain the following information: BFS: distance from the source on each vertex on the row once the algorithm completed 3 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 4 (*notice that the vlues are arbitrary, just refer to the format) (*if you prefer, you may output just in a linear array such as 3 2 1 0 4, but nxn matrix is a more efficient format for debugging and tracing purpose))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!