Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1318674

Browse files
Graph DFS implemented
1 parent f49ca08 commit 1318674

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/me/premaseem/datastructure/graph/Graph.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void DFSR(int v, boolean[] visited){
6666
DFSR(vert,visited);
6767
}
6868
}
69-
System.out.print(" DFS visiting "+ v);
69+
System.out.println(" DFS visiting "+ v);
7070

7171
}
7272

@@ -83,7 +83,7 @@ void BFS(int v){
8383

8484
while(!q.isEmpty()){
8585
Integer vert = q.poll();
86-
System.out.print(" >>"+vert);
86+
System.out.println(" BFS visiting "+vert);
8787

8888
// getting the adjacent and adding them to q if they not been visited before
8989
LinkedList<Integer> adj = this.vertex[vert];

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /