Implement BFS using Queue