Algorithms questions

Q6

GATE CS 2013 CSSearching Sorting and HashingMCQ1 mark−1/3 if wrong
Which one of the following is the tightest upper bound that represents the number of swaps required to sort nn numbers using selection sort?
Show answer without attempting

Answer: B

Q18

GATE CS 2013 CSAlgorithm DesignMCQ1 mark−1/3 if wrong
Which of the following statements are TRUE?

1. The problem of determining whether there exists a cycle in an undirected graph is in P.
2. The problem of determining whether there exists a cycle in an undirected graph is in NP.
3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.
Show answer without attempting

Answer: A

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

0/50 correct0 marks

Related topics in GATE CS