From ae3b3ca0ca9fd3b8ec0aa5da84dc2276b398bbfd Mon Sep 17 00:00:00 2001 From: vamsee Date: Fri, 19 Nov 2021 17:00:39 +0530 Subject: java/BFS: Print according to fornax format --- algorithms/java/BFS.java | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/algorithms/java/BFS.java b/algorithms/java/BFS.java index a6f368a..d31d941 100644 --- a/algorithms/java/BFS.java +++ b/algorithms/java/BFS.java @@ -62,9 +62,6 @@ class BFS { System.out.println(); if (maze[curx][cury] == '$') { path[curx][cury]=new Coordinates(start.x,start.y); - - System.out.println("Path found"); - boolean[][] printpath=new boolean[maze.length][maze.length]; for (int q = 0; q < maze.length; q++) { for (int j = 0; j < maze.length; j++) { @@ -80,16 +77,28 @@ class BFS { //path stores parent of current coordinate } - for(int d=0;d