GATE CS 2016 · Set-2 · Shortest Path Algorithms

MCQ · 2 marks · Problem PROG-GRPH-0064

In an adjacency list representation of an undirected simple graph G = (V,E), each edge (u,v) has two adjacency list entries: [v] in the adjacency list of u, and [u] in the adjacency list of v. These are called twins of each other. A twin pointer is a pointer from an adjacency list entry to its twin. If |E|=m and |V|=n, and the memory size is not a constraint, what is the Asymptotic Notation of the most efficient algorithm to set the twin pointer in each entry in each adjacency list?
  1. A
    \(\Theta (n^{2})\)
  2. B
    \(\Theta (n+m)\)
  3. C
    \(\Theta (m^{2})\)
  4. D
    \(\Theta (n^{4})\)

Solve it on GATE DA practice →More Graph Theory & Algorithms problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/39620/gate2016-2-41

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com