How to print the BFS path from a source to a target in a maze
问题 I'm trying to implement the BFS in order to find the shortest path from a source to a target in a maze. The problem that I'm having is that I'm unable to print the path, it is printed with '*' in the maze, but how can I extract the path from the predecessors of the BFS without printing all the visited nodes? Here's my code for you to compile: #include <stdio.h> #include <stdlib.h> #include <string.h> struct coord{ //This is a struct I'll use to store coordinates int row; int col; }; //-------