Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Program in C++/Java that performs a DFS(depth first search)

  • Write a program in C++/Java that performs a DFS onfollowinggraphandouputsedges with labels, tree edge, back edge, forward edge and cross edge.Submit yourprogram and screen shot of outputs in a singleword/pdffile.

    Your program should accept following file as an input. You have to write codeto process this input. You should define and use adjacency list representationof graph.

    The input in the file is in this format:

    First line is number of nodes.

    Rest of lines are in thisformat:node number (node degree) : adjacency list

file:

11

0  (4) : 1 6 8 10

1  (3) : 0 2 3

2  (5) : 1 3 4 5 6

3  (2) : 1 2

4  (2) : 2 5

5  (2) : 2 4

6  (3) : 0 2 7

7  (1) : 6

8  (2) : 0 9

9  (1) : 8

10 (1) : 0

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question