BFS implementation without using a queue. O(V+E) time and O(V) space.
Useful for languages like JS that don't have a built-in queue.

BFS implementation without using a queue. O(V+E) time and O(V) space.
Useful for languages like JS that don't have a built-in queue.
