GATEverse Practice, past papers & mock tests
GATE 2025 · session-5
Programming, Data Structures and AlgorithmsGraph TraversalsmediumNAT2 marks
Consider a directed graph \( G = (V,E) \), where \( V = \{0,1,2,\dots,100\} \) and \[ E = \{(i,j) : 0 < j - i \leq 2, for all i,j \in V \}. \] Suppose the adjacency list of each vertex is in decreasing order of vertex number, and depth-first search (DFS) is performed at vertex 0. The number of vertices that will be discovered after vertex 50 is:
Save your progress

Related Programming, Data Structures and Algorithms PYQs