Breadth first search in graph using queue. University assignment.