Data Abstract Structure in Java. I recieved notes onimplementing BFS Algorithm. I’m using our own built-in Queue.javaand List.class. Not importing java.util.LinkedList/Queue. I haveaddLast(),addFirst(), enqueue(), dequeue() methods. I’m stuckcompleting this method.
![1.1. BFS Algorithm BFS (G,_ s) for all x in V (G) color[x] white distance [x]1 parent [x] -Mil color [s] grey distance [s]0 Enqueue (Q,s) while (Q is not empty) xfront of Q Dequeue (Q,x) for a11 y in adj [x] if color [y]white color [y] = grey distance [y] -distance [x] 1 parent yx Enqueue (Q, y) color [x] = black](../../../media.cheggcdn.com/media/ba6/ba6cb997-3cd5-46fb-a1e3-2756bed0a6f5/phplp83X0.png)
/**
* Performs breath first
PayPal Gateway not configured
PayPal Gateway not configured