You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement in JavaScript the BFS algorithm (Breadth First Search) to find the shortest path to exit from a labyrinth, starting from certain cell.
Print the shortest path as sequence of adjacent cells from start to the exit. If several shortest paths exist, print one of them. If no path goes outside of the labyrinth, print "No path to exit the labyrinth".
Implement in JavaScript the BFS algorithm (Breadth First Search) to find the shortest path to exit from a labyrinth, starting from certain cell.
Print the shortest path as sequence of adjacent cells from start to the exit. If several shortest paths exist, print one of them. If no path goes outside of the labyrinth, print "No path to exit the labyrinth".
Sample labyrinth (maze) definition in JS:
Sample output from your solution for the above example:
The text was updated successfully, but these errors were encountered: