GATEverse
← GATE CSE 1992

Q8

NATMarks unknown

Let TT be a Depth First Tree of a undirected graph GG. An array PP indexed by the vertices of GG is given. P[V]P[V] is the parent of vertex VV, in TT. Parent of the root is the root itself. Give a method for finding and printing the cycle formed if the edge (u,v)(u,v) of GG not in TT (i.e., e∈G−Te \in G-T) is now added to TT. Time taken by your method must be proportional to the length of the cycle. Describe the algorithm in a PASCAL (C)(C) – like language. Assume that the variables have been suitably declared.

Sign in to save attempts.

Loading…