I was trying to understand how to print all possible path using BFS or dfs. For this I used this link code src to des path using BFS geekforgeeks
But i cant understand this code as I dont know about vector a lot. I want to rewrite this code into without using any library like queue or vector. But I dont know how i can convert it. As I really can’t understand some of the syntax here so cant figure out the logic also.
like i want to convert this without using any vector
for (int i = 0; i < g[last].size(); i++) {
if (isNotVisited(g[last][i], path)) {
vector<int> newpath(path);
newpath.push_back(g[last][i]);
q.push(newpath);
}
}
Can anyone help how I can do it? I dont want to use recursion as it’s quite difficult for me