Skip to content

Breadth first search and Depth first search on undirected graphs

Notifications You must be signed in to change notification settings

shyamliagrawal/bfsdfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bfsdfs

Breadth first search and Depth first search on undirected graphs:

Execute make command to compile

The executable "bfs_dfs" takes input as:

  1. Number of vertices
  2. Number of edges
  3. Then it takes all the edges one by one in format v1 v2 where v1, v2 are vertices respectively. 1 <= v1,v2 <= n where n = number of vertices.

Output is both the Breadth First Search and Depth First Search starting from node 1. For disconnected graph, the search will contain multiple lines, one for each component.

About

Breadth first search and Depth first search on undirected graphs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published