- Copy and Paste code into dreampuf.github.io/GraphvizOnline
Steps to run the project:
- Run
Driver.java
andSocialNetwork.java
. - Done
BFS(graph, startNode):
// Create an empty queue and mark startNode as visited
queue = createEmptyQueue()
mark startNode as visited
enqueue startNode into the queue
while queue is not empty:
current = dequeue from the queue
process current node
// Explore neighbors of the current node
for each neighbor of current:
if neighbor is not visited:
mark neighbor as visited
enqueue neighbor into the queue