Algorithm: MCQ Set – 02

Algorithm: MCQ Set – 02

Q11: Which is not the property of Quick sort

  • (A) Inplace
  • (B) Adaptive
  • (C) Stable
  • (D) Online

Q12: The Worst case occur in linear search algorithm when

  • (A) Item is somewhere in the middle of the array
  • (B) Item is not in the array at all
  • (C) Item is the first element in the array
  • (D) Item is the last element in the array or is not there at all

Q13: The correct matching for the following pairs is

(A) 0/1 Knapsack                      (1) Greedy

(B) Quick sort                           (2) Depth-first search

(C) Minimum weight                (3) Dynamic programming

(D) Connected Components     (4) Divide and conquer

  • (A) A-2 , B-4 , C-1, D-3
  • (B) A-3 , B-4 , C-l , D-2
  • (C) A-3 , B-4 , C-2 , D-1
  • (D) A-4 , B-1 , C-2 , D-3

Q14: A Bi-connected Graph Certainly does not contain any

  • (A) Cycle
  • (B) Path
  • (C) Parallel Edges
  • (D) Cut Vertex

Q15: The number of ways to multiply 4 Matrices in a Chained Matrix Multiplication

  • (A) 2
  • (B) 3
  • (C) 4
  • (D) 5

Q16: The spanning tree of connected graph with 10 vertices contains

  • (A) 9 edges
  • (B) 10 edges
  • (C) 11 edges
  • (D) 11 vertices

Q17: Consider the following statements.

I. An algorithm is a no. of steps to be performed to solve a problem.
II. To a given problem there may be more than one algorithm

  • (A) Only I is correct
  • (B) Only II is correct
  • (C) Both I and II are false
  • (D) Both I and II are correct

Q18: At least how many comparisons are required for merging two sorted lists of n elements each?

  • (A) 2n -1
  • (B) n-1
  • (C) 2n+1
  • (D) n

Q19: For an undirected graph with n vertices and e edges, the sum of the degree of each vertex is equal to

  • (A) 2n
  • (B) (2n-1)/2
  • (C) 2e
  • (D) e2 /2

Q20: Which of the following shows the correct relationship?

  • (A) O(nlog(n) ) < O(n)
  • (B) O(2n)  <  O(n2 )
  • (C) O(n3) < O(n2log(n) )
  • (D) O(log(n) ) < O(n)

Answer:

QuestionQ11Q12Q13Q14Q15Q16Q17Q18Q19Q20
AnswerDDBDDADACD