PROGRAMMING:List Components
For a given undirected graph with N vertices and E edges, please list all the connected components by both DFS (Depth First Search) and BFS (Breadth First Search). Assume that all the vertices are numbered from 0 to N-1. While searching, assume that we always start from the vertex with the smallest index, and visit its adjacent vertices in ascending order of their indices.
### Input Specification:
Each input file contains one test case. For each case, the first line gives two integers N (0$$<$$N$$\le$$10) and E, which are the number of vertices and the number of edges, respectively. Then E lines follow, each described an edge by giving the two ends. All the numbers in a line are separated by a space.
### Output Specification:
For each test case, print in each line a connected component in the format { $$v_ 1$$ $$v_ 2$$ ... $$v_ k$$ }. First print the result obtained by DFS, then by BFS.
### Sample Input:
```in
8 6
0 7
0 1
2 0
4 1
2 4
3 5
```
### Sample Output:
```out
{ 0 1 4 2 7 }
{ 3 5 }
{ 6 }
{ 0 1 2 7 4 }
{ 3 5 }
{ 6 }
```
answer:If there is no answer, please comment
### Input Specification:
Each input file contains one test case. For each case, the first line gives two integers N (0$$<$$N$$\le$$10) and E, which are the number of vertices and the number of edges, respectively. Then E lines follow, each described an edge by giving the two ends. All the numbers in a line are separated by a space.
### Output Specification:
For each test case, print in each line a connected component in the format { $$v_ 1$$ $$v_ 2$$ ... $$v_ k$$ }. First print the result obtained by DFS, then by BFS.
### Sample Input:
```in
8 6
0 7
0 1
2 0
4 1
2 4
3 5
```
### Sample Output:
```out
{ 0 1 4 2 7 }
{ 3 5 }
{ 6 }
{ 0 1 2 7 4 }
{ 3 5 }
{ 6 }
```
answer:If there is no answer, please comment