Posts

Showing posts with the label dfs

Graph Searching (BFS&DFS) Implementation

Image
Here is the adjacency matrix representation based implementation of Graph with both graph searching techniques . Following graph has been taken as example Adjacency matrix representation is below int array[][] = {{0,1,1,0,0,0},                      {1,0,0,1,1,0},                      {1,0,0,0,0,1},                      {0,1,0,0,0,0},                      {0,1,0,0,0,0},                      {0,0,1,0,0,0}}; Complete Code is as follows package demo.graph;...