Skip to content

Commit 0abf46b

Browse files
committed
added
1 parent c30f696 commit 0abf46b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ public static void BFS(String src){ // BREADTH-FIRST-SEARCH
3333
if(adj.isEmpty()) return;
3434

3535
HashSet<String> set=new HashSet<>();
36-
Queue<String> q=new LinkedList<>();
36+
Queue<String> q=new LinkedList<>(); //BFS uses Queue data structure
3737
q.offer(src);
3838
set.add(src);
3939

40-
while(!q.isEmpty()){
40+
while(!q.isEmpty()){
4141
String node=q.poll();
4242
System.out.print(node+" ");
4343
List<Node> neighbours=adj.get(src);

0 commit comments

Comments
 (0)