Algorithm: MCQ Set – 09

Algorithm: MCQ Set – 09

Q81: The depth of a complete binary tree is given by

  • (A) Dn = n log2n
  • (B) Dn = n log2n+1
  • (C) Dn = log2n
  • (D) Dn = log2n+1

Q82: Which of the following algorithms solves the all-pair shortest path problem?

  • (A) Dijkstra’s algorithm
  • (B) Floyd’s algorithm
  • (C) Prim’s algorithm
  • (D) Warshall’s algorithm

Q83: Total Degree of a Triangle is

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

Q84: For a same problem If Time Complexity of Recursive algorithm is x and Time Complexity of Iterative algorithm is y, then

  • (A) x  < y
  • (B) x  > y
  • (C) x = y
  • (D) can not be said

Q85: Worst case Time Complexity of Addition of  two n X n Matrix  is

  • (A) n2
  • (B) n2log(n)
  • (C) n log(n)
  • (D) n3

Q86: In a Selection Sort of n elements, how many times is the swap function called in the complete execution of the algorithm?

  • (A) 1
  • (B) n – 1
  • (C) n log(n)
  • (D) n2

Q87: T(n) = 2 T(n/2) + k.n  , where k is constant, then T(n) is equal to

  • (A) O(n log(n))
  • (B) O( log(n) )
  • (C) O(n )
  • (D) O(n2 )

Q88: The running time for creating a heap of size n is

  • (A) O (n)
  • (B) O (log n)
  • (C) O (n log n)
  • (D) O (n2)

Q89: Search tables used by compilers for efficient searching generally use

  • (A) Hash Tables
  • (B) Linear lists of Records
  • (C) Binary Search Tables
  • (D) Binary Search Trees

Q90: If P(n) = n2 then what is correct?

  • (A) P(n) = n3
  • (B) P(n) = n4
  • (C) P(n) = n2
  • (D) All of the above

Answer:

QuestionQ81Q82Q83Q84Q85Q86Q87Q88Q89Q90
AnswerDBABABACAD