• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Top 50 Algorithms MCQs with Answers

Question 31

Given an array that represents elements of arithmetic progression in order. It is also given that one element is missing in the progression, the worst case time complexity to find the missing element efficiently is:
  • Θ(n)
  • Θ(nLogn)
  • Θ(Logn)
  • Θ(1)

Question 32

The cube root of a natural number n is defined as the largest natural number m such that m3 ≤ n. The complexity of computing the cube root of n (n is represented in binary notation) is:
  • O(n) but not O(n0.5)
  • O(n0.5) but not O((log n)k) for any constant k > 0
  • O((log n)k) for some constant k > 0, but not O ((log log n)m) for any constant m > 0
  • O((log log n)m) for some constant k > 0.5, but not O((log log n)0.5)

Question 33

The minimum number of arithmetic operations required to evaluate the polynomial P(X) = X5 + 4X3 + 6X + 5 for a given value of X using only one temporary variable.
  • 6
  • 7
  • 8
  • 9

Question 34

The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is 

  • θ(n)

  • θ(logn)

  • θ(nlogn)

  • θ(1)

Question 35

In a complete k-ary tree, every internal node has exactly k children. The number of leaves in such a tree with n internal nodes is: 

  • nk

  • (n – 1) k+ 1

  • n( k – 1) + 1

  • n( k – 1)

Question 36

A problem in NP is NP-complete if  

  • It can be reduced to the 3-SAT problem in polynomial time

  • The 3-SAT problem can be reduced to it in polynomial time

  • It can be reduced to any other problem in NP in polynomial time

  • Some problem in NP can be reduced to it in polynomial time

Question 37

Consider the following two problems of graph. 1) Given a graph, find if the graph has a cycle that visits every vertex exactly once except the first visited vertex which must be visited again to complete the cycle. 2) Given a graph, find if the graph has a cycle that visits every edge exactly once. Which of the following is true about above two problems.
  • Problem 1 belongs NP Complete set and 2 belongs to P
  • Problem 1 belongs to P set and 2 belongs to NP Complete set
  • Both problems belong to P set
  • Both problems belong to NP complete set

Question 38

Let SHAM3 be the problem of finding a Hamiltonian cycle in a graph G = (V,E) with V divisible by 3 and DHAM3 be the problem of determining if a Hamiltonian cycle exists in such graphs. Which one of the following is true?
  • Both DHAM3 and SHAM3 are NP-hard
  • SHAM3 is NP-hard, but DHAM3 is not
  • DHAM3 is NP-hard, but SHAM3 is not
  • Neither DHAM3 nor SHAM3 is NP-hard

Question 39

Which of the following is true about NP-Complete and NP-Hard problems.
  • If we want to prove that a problem X is NP-Hard, we take a known NP-Hard problem Y and reduce Y to X
  • The first problem that was proved as NP-complete was the circuit satisfiability problem.
  • NP-complete is a subset of NP Hard
  • All of the above
  • None of the above

Question 40

Assuming P != NP, which of the following is true ? 
(A) NP-complete = NP

(B) NP-complete [Tex]\\cap [/Tex]P = [Tex]\\Phi [/Tex]

(C) NP-hard = NP

(D) P = NP-complete
 

  • A

  • B

  • C

  • D

There are 50 questions to complete.

Last Updated :
Take a part in the ongoing discussion