Algorithms questions — page 7 of 7

Q19

GATE CS 2013 CSGraph AlgorithmsMCQ1 mark−1/3 if wrong
What is the time complexity of Bellman-Ford single-source shortest path algorithm on a complete graph of nn vertices?
Show answer without attempting

Answer: C

Q30

GATE CS 2013 CSSearching Sorting and HashingMCQ2 marks−2/3 if wrong
The number of elements that can be sorted in Θ(log⁡n)\Theta(\log n) time using heap sort is
Show answer without attempting

Answer: C

Q31

GATE CS 2013 CSAlgorithm AnalysisMCQ2 marks−2/3 if wrong
Consider the following function:
int unknown(int n){
  int i, j, k=0;
  for (i=n/2; i<=n; i++)
    for (j=2; j<=n; j=j*2)
      k = k + n/2;
  return (k);
}
The return value of the function is
Show answer without attempting

Answer: B

Q18

GATE CS 2012 CSAlgorithm AnalysisMCQ1 mark−1/3 if wrong
Let W(n)W(n) and A(n)A(n) denote respectively, the worst case and average case running time of an algorithm executed on an input of size nn. Which of the following is ALWAYS TRUE?
Show answer without attempting

Answer: C

Q29

GATE CS 2012 CSGraph AlgorithmsMCQ2 marks−2/3 if wrong
Let GG be a weighted graph with edge weights greater than one and G′G' be the graph constructed by squaring the weights of edges in GG. Let TT and T′T' be the minimum spanning trees of GG and G′G', respectively, with total weights tt and t′t'. Which of the following statements is TRUE?
Show answer without attempting

Answer: Marks to all

Q39

GATE CS 2012 CSSearching Sorting and HashingMCQ2 marks−2/3 if wrong
A list of nn strings, each of length nn, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is
Show answer without attempting

Answer: Marks to all

Q40

GATE CS 2012 CSGraph AlgorithmsMCQ2 marks−2/3 if wrong
Consider the directed graph shown in the figure below. There are multiple shortest paths between vertices S and T. Which one will be reported by Dijkstra's shortest path algorithm? Assume that, in any iteration, the shortest path to a vertex vv is updated only when a strictly shorter path to vv is discovered.
Question figure
Show answer without attempting

Answer: D

0/70 correct0 marks

Related topics in GATE CS