Skip to content

Commit a20942d

Browse files
authored
Update BFS.java
1 parent 9694fff commit a20942d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

BFS.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ public void bfs(int startVertex)
5656
} /* end dfs */
5757

5858
public static void main(String[] args) {
59-
System.out.println("\nEnter start vertex :");
59+
BFS graph = new BFS();
60+
System.out.print("\nEnter start vertex :");
6061
int startVertex = new Scanner(System.in).nextInt();
61-
new BFS().bfs(startVertex);
62+
graph.bfs(startVertex);
6263
}
6364
}

0 commit comments

Comments
 (0)