F5 Interview Question

Perform Breadth First Search and code it