• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top MCQs on Complexity Analysis of Algorithms with Answers

Question 31

An unordered list contains n distinct elements. The number of comparisons to find an element in this list that is neither maximum nor minimum is
  • Θ(nlogn)
  • Θ(n)
  • Θ(logn)
  • Θ(1)

Question 32

Q13 The equality above remains correct if X is replace by
  • Only I
  • Only II
  • I or III or IV but not II
  • II or III or IV but not I

Question 33

In the following table, the left column contains the names of standard graph algorithms and the right column contains the time complexities of the algorithms. Match each algorithm with its time complexity.
 1. Bellman-Ford algorithm 2. Kruskal’s algorithm 3. Floyd-Warshall algorithm 4. Topological sorting  A : O ( m log n) B : O (n3) C : O (nm) D : O (n + m)
 
  • 1→ C, 2 → A, 3 → B, 4 → D
  • 1→ B, 2 → D, 3 → C, 4 → A
  • 1→ C, 2 → D, 3 → A, 4 → B
  • 1→ B, 2 → A, 3 → C, 4 → D

Question 34

Let T(n) be a function defined by the recurrence T(n) = 2T(n/2) + √n for n ≥ 2 and T(1) = 1 Which of the following statements is TRUE?  

  • T(n) = θ(log n)

  • T(n) = θ(√n)

  • T(n) = θ(n)

  • T(n) = θ(n log n)

Question 35

Suppose we want to arrange the ii numbers stored in an array such that all negative values occur before all positive ones. Minimum number of exchanges required in the worst case is:
  • n-1
  • n
  • n+1
  • None of the above

Question 36

The characters a to h have the set of frequencies based on the first 8 Fibonacci numbers as follows
a : 1, b : 1, c : 2, d : 3, e : 5, f : 8, g : 13, h : 21/
A Huffman code is used to represent the characters. What is the sequence of characters corresponding to the following code? 110111100111010
  • fdheg
  • ecgdf
  • dchfg
  • fehdg

Question 37

What is the size of the smallest MIS(Maximal Independent Set) of a chain of nine nodes?
  • 5
  • 4
  • 3
  • 2

Question 38

Arrange the following functions in increasing asymptotic order:
A. n1/3
B. en
C. n7/4
D. n log9n
E. 1.0000001n
  • A, D, C, E, B
  • D, A, C, E, B
  • A, C, D, E, B
  • A, C, D, B, E

Question 39

The two numbers given below are multiplied using the Booth\'s algorithm.
Multiplicand : 0101 1010 1110 1110
Multiplier: 0111 0111 1011 1101
How many additions/Subtractions are required for the multiplication of the above two numbers?
  • 6
  • 8
  • 10
  • 12

Question 40

The minimum number of record movements required to merge five files A (with 10 records), B (with 20 records), C (with 15 records), D (with 5 records) and E (with 25 records) is:
  • 165
  • 90
  • 75
  • 65

There are 118 questions to complete.

Last Updated :
Take a part in the ongoing discussion