Page 1 of 1

The directed graph is given in the form of an adjacency list. The vertices are numbered from 1 to n. Run a depth-first s

Posted: Sat Jul 09, 2022 11:48 am
by answerhappygod
The Directed Graph Is Given In The Form Of An Adjacency List The Vertices Are Numbered From 1 To N Run A Depth First S 1
The Directed Graph Is Given In The Form Of An Adjacency List The Vertices Are Numbered From 1 To N Run A Depth First S 1 (43.39 KiB) Viewed 21 times
please write code in java or c++ language asap it is urgenttask
The directed graph is given in the form of an adjacency list. The vertices are numbered from 1 to n. Run a depth-first search on the graph. Find the value of timestamp d[v] or f[v] for a specified vertex v. Input The first line contains the number of vertices n. The next i-th line contains the number of edges adjacent to the i-th vertex and the vertex numbers where these edges go. Output Print the value of d[4]. Sample input 0 2 1 3 15 0 0 12 Sample output 9 4 1/2 9/10 1 5 6 11/12 5/6 3/8 3 4/7] 1 2 3 4 5 6 () (1,3) (5) () () (2) Act Go t