Algorithm: MCQ Set – 04

Algorithm: MCQ Set – 04

Q31: The correct matching for the following pairs is

(A) 0/1 Knapsack                        (1) Greedy

(B) Multiply numbers                 (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

Q32: The complexity of Bubble sort algorithm is

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

Q33: For the bubble sort algorithm, what is the time complexity of the best/worst case? (assume that the computation stops as soon as no more swaps in one pass)

  • (A) best case: O(n) worst case: O(n*n)
  • (B) best case: O(n) worst case: O(n*log(n))
  • (C) best case: O(1) worst case: O( n )
  • (D) best case: O(n*log(n)) worst case: O(n*n)

Q34: Max Heap Tree has following Property.

  • (A) Right Child > Parent
  • (B) Both Children > Parent
  • (C) Both Children < Parent
  • (D) None of above

Q35: Breadth First Search method uses

  • (A) Stack
  • (B) Queue
  • (C) Hash Table
  • (D) None of these

Q36: In a heap tree bottom level should be filled

  • (A) From left to right.
  • (B) From right to left.
  • (C) Completely.
  • (D) None of these

Q37: The running time of an algorithm means

  • (A) No. of Primitive Operations(Steps) executed in a machine- independent manner
  • (B) Time taken on a Standard Computer to execute the program
  • (C) Time taken by the algorithm on a particular input size.
  • (D) None of these

Q38: What is the preferred form of representation of Dense graph?

  • (A) Adjacency Matrix
  • (B) Adjacency List
  • (C) Incidence Matrix
  • (D) None of these

Q39: A BST is traversed in the following order recursively: Right, root, left. The output sequence will be in

  • (A) Ascending order
  • (B) Descending order
  • (C) Bitomic sequence
  • (D) No specific order

Q40: The way a card game player arranges his cards as he picks them up one by one , is an example of

  • (A) Bubble Sort
  • (B) Selection Sort
  • (C) Insertion Sort
  • (D) Merge Sort

Answer:

QuestionQ31Q32Q33Q34Q35Q36Q37Q38Q39Q40
AnswerBCACBAAABC