Skip to content
This repository was archived by the owner on Nov 26, 2019. It is now read-only.

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Breadth First Traversal

This program inputs a graph and traverses through it breadth first. It uses the traditional enqueue operations to achieve the same.

Input Format

  • The input consisits of T+1 lines
  • The first line of input contains T and val
  • It follows with T lines of vertex-vertex pairs

Output Format

A single line which shows traversal of the graph from a vertex.

Sample Input

6 2
0 1
0 2
1 2
2 0
2 3
3 3

Sample Output

2 0 3 1

Implemented in: