Monday, June 11, 2018

Breadth first search(BFS), Depth first Search(DFS) both iterative and recursive in Java

Graph can be represented in two ways:
 1)adjacency matrix
  2) adjancency list


Note here we create array of linkedlist. Array are of size length vertices.
Each array has all its childrens so each array is linkedlist  of size vertices V.






No comments:

Post a Comment