Small Java Project to implement Breadth First Search Algorithm

Job ID: 32156914

Budget: $10 – $30 USD

Using Java
implement the Breadth-First Search
(BFS) algorithm:
BFS(s):
Set Discovered[s] = true and Discovered[v] = false for all other v
Initialize L[0] to consist of the single element s
Set the layer counter i = 0
Set the current BFS tree T = ∅
While L[i] is not empty
Initialize an empty list L[i + 1]
For each node u ∈ L[i]
Consider each edge (u, v) incident to u
If Discovered[v] = false then
Set Discovered[v] = true
Add edge (u, v) to the tree T
Add v to the list L[i + 1]
Endif
Endfor
Increment the layer counter i by one
Endwhile
In your implementation, use adjacency list to ensure O(m+n) space for representing graphs. Also, ensure to have
a O(m + n) running time as you implement the BFS(s) function.

your code should have the following three files
1. Node.java (a class file that implements node of a graph)
2. LinkedList.java (a class file that implements various linked list operation for representing a graph using
adjacency list)
3. BFSTest.java (a driver class file that reads a graph file, implements the BFS algorithm, and outputs the
BFS tree)