Discussion
The discovery and finish time for the vertex 5 in depth first traversal for the following graph is :

Answer: B
Vertex 5 is discovered at time 4 and finished at time 5, so the answer is 4, 5.
Vertex 5 has no outgoing edges, so once depth first search discovers it at time d, it has nothing to explore and finishes immediately at time d + 1. Of the options, only (4, 5) has the finish time exactly one more than the discovery time, which rules out (3, 5), (2, 6) and (1, 3).
One search giving these times starts at vertex 3, the only vertex with no incoming edge: 3 is discovered at time 1, 1 at time 2, 2 at time 3 and then 5 at time 4, and 5 finishes at time 5.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development