Data Structure

DFS In Data Structure

In DFS edges are explored out of the most recently discovered vertex (V) that still has unexplored edges leaving it. When all the V’s edges have been explored the search backtracks to explore edges leaving the vertex from which ‘V’ was discovered. This process continues until we have discovered all the vertices that are reachable

DFS In Data Structure Read More »

BFS in Data Structure

BFS is an easy and simplest algorithm for searching a graph and this algorithm works on both directed and Undirected graph .Many algorithm uses the idea of BFS like prism algorithm and Dijkstra Algorithm. Given a graph G = {V,E} and a distinguished source vertex ‘S’ . BFS Systematically explores the edges of G to

BFS in Data Structure Read More »