Depth First Search

Enter the adjacency list of your graph. Each line must start with a vertex label. The other tokens in the line for a vertex u describe the adjacency list of u. Separate the tokens with space(s).

In the example below, the vertex u is adjacent with vertices x and y.

The maximum input length is limited by 300 characters including spaces.

Program output

Source code