Adding simple BFS(using arrays)code