Design and Analysis of Algorithms MCQ With Answers PDF
Design and Analysis of Algorithms MCQ With Answers PDF
2. The measure of the longest amount of time possibly taken to complete an algorithm is
expressed as __.
a. Little-O
b. Little-Omega
c. Big-Omega
d. Big-O
Ans: D
5. Potential function method is the technique that performs an amortized analysis based
on ___.
a. Financial model
b. Computational model
c. Algorithm analysis
d. Energy model
Ans: D
6. ___ is the maximum amount of time an algorithm takes to execute a specific set of
inputs.
a. Running time
b. Average case time complexity
c. Worst case time complexity
d. Best case time complexity
Ans: C
7. ___ within the limit deals with the behavior of a function for sufficiently large values of
its parameter.
a. Asymptotic notation
b. Big-Oh notation
c. Omega notation
d. Theta notation
Ans: A
34. With respect to finding the time complexity of Kruskal’s algorithm, which operation
keeps track of the parent pointer until it reaches the root parent?
a. Makeset
b. Union
c. Find
d. Merge
Ans: C
35. ___ means calculating the minimum amount of work required to solve the problem.
a. Upper-bound
b. Lower–bound
c. Adversary
d. Problem reduction
Ans: B
37. An algorithm that defines every operation exclusively is called ___ algorithm.
a. NP-hard
b. Deterministic
c. Non-deterministic
d. NP-complete
Ans: B
38. ___ problems include counting of structures of a specific kind and identifying the
largest, smallest or optimal objects.
a. Combinatorial
b. Traveling Salesman
c. Knapsack problem
d. Use cases
Ans: A
39. ___ is a sequence of data elements connected to each other where every element has a
link field referring to the location of the next element.
a. Array
b. Stack
c. List
d. Queue
Ans: C
40. ___ organizes details of all candidate solutions and discards large subsets of fruitless
candidates by using upper and lower estimated bounds of the quantity being optimized.
a. Approximation algorithms
b. Dynamic programming
c. Greedy algorithm
d. Branch and Bound
Ans: D
34. With respect to finding the time complexity of Kruskal’s algorithm, which operation
keeps track of the parent pointer until it reaches the root parent?
a. Makeset
b. Union
c. Find
d. Merge
Ans: C
35. ___ means calculating the minimum amount of work required to solve the problem.
a. Upper-bound
b. Lower–bound
c. Adversary
d. Problem reduction
Ans: B
36. In a decision tree, a node represents a ___.
a. Input value
b. Output value
c. Solution
d. Decision
Ans: D
37. An algorithm that defines every operation exclusively is called ___ algorithm.
a. NP-hard
b. Deterministic
c. Non-deterministic
d. NP-complete
Ans: B
38. ___ problems include counting of structures of a specific kind and identifying the
largest, smallest or optimal objects.
a. Combinatorial
b. Traveling Salesman
c. Knapsack problem
d. Use cases
Ans: A
39. ___ is a sequence of data elements connected to each other where every element has a
link field referring to the location of the next element.
a. Array
b. Stack
c. List
d. Queue
Ans: C
40. ___ organizes details of all candidate solutions and discards large subsets of fruitless
candidates by using upper and lower estimated bounds of the quantity being optimized.
a. Approximation algorithms
b. Dynamic programming
c. Greedy algorithm
d. Branch and Bound
Ans: D
42. The two main conditions for theta notation are ___ and___.
a. f(n)=O(g(n)), f(n)≠Θ(g(n))
b. f(n)>O(g(n)), f(n)=Θ(g(n))
c. f(n)≠O(g(n)), f(n)≥Θ(g(n))
d. f(n)>O(g(n)), f(n)>Θ(g(n))
Ans: A
43. Identify the true and false statements from the following with respect to measuring the
running time of an algorithm.
1. Firstly, recognize the basic operation of an algorithm.
2. Identifying the basic operation of an algorithm is difficult.
a. 1-T, 2-F
b. 1-T, 2-T
c. 1-F, 2-T
d. 1-F, 2-F
Ans: A
44. The two primitive operations of the function Fact(x) are ___ and ___.
a. Indexing an array, comparing two numbers
b. To check if the value of x is 1, To multiply x and Fact(x-1)
c. To check if the value of x is 1, To multiply x
d. To multiply x and Fact(x-1), Compare two numbers
Ans: B
45. The smoothness rule assumes that T(n) Є Θ(n2) if ___ is a smooth function and ___ is
eventually non-decreasing.
a. n2, T(n)
b. Θ(n2), T(n)
c. T(n), n2
d. Θ(n),n
Ans: A
46. In which method of coding does the code of a symbol not depend on the frequency of
occurrence of that symbol?
a. Variable length coding
b. Fixed length coding
c. Static Huffman coding
d. Adaptive Huffman coding
Ans: B
47. Which among the following is not a reason to perform the empirical analysis?
a. To check the accuracy of the algorithm.
b. To reduce the use of mathematical analysis and algorithm visualization.
c. To compare the efficiencies of different algorithms working to solve the same problem.
d. To develop the algorithm’s efficiency class.
Ans: B
48. In distribution counting, one array is used to store ___ value and another to store ___
list of elements.
a. Frequency, Sorted
b. Distribution, Sorted
c. Frequency, Unsorted
d. Sorted, Unsorted
Ans: B
49. In a knapsack problem, if a set of items are given, each with a weight and a value, the
goal is to find the number of items that ___ the total weight and ___ the total value.
a. Minimizes, Minimizes
b. Maximizes, Maximizes
c. Maximizes, Minimizes
d. Minimizes, Maximizes
Ans: D
1. The rules for performing arithmetic using Arabic numerals were originally known as
___.
Ans. Algorism
2. The efficiency of algorithms depends upon ___, ___ and ___ consumption.
Ans. Speed, size, resources
6. ___ is the expression of an algorithm in a programming language with all the language-
specific codes.
Ans. Programs
8. ___ is the method of expressing the upper bound of an algorithm’s running time.
Ans. Big – O
27. ___ technique is used to perform an amortized analysis method based on a financial
model.
Ans. Accounting method
28. If you can set up such a scheme called an amortization scheme then each operation in
the series has an ___.
Ans. Amortised running time O(a)
29. ___ technique is used to perform an amortized analysis method based on an energy
model.
Ans. Potential function method
32. In prefixAverages2 algorithm ___ is the time taken for initiating the variables.
Ans. O(1)
33. Recursive procedure should define a ___ which is small enough to solve without using
recursion.
Ans. Base case
34. ___ of the algorithm means analyzing the behaviour of the algorithm with a specific
set of inputs.
Ans. Empirical analysis
35. We can measure the efficiency of algorithms using ___ and ___ methods.
Ans. Counters, system clocking
36. The ___ analysis of the algorithm makes it easy to study.
Ans. Pictorial
37. ___ is defined as a technique that uses images to convey information about algorithms.
Ans. Algorithm visualization
38. ___ visualization is the type of visualization that uses still images to illustrate the
algorithm.
Ans. Static algorithm
39. ___ visualization is the type of visualization that uses animations to illustrate the
algorithm. This is also known as algorithm animation.
Ans. Dynamic algorithm
40. ___ is defined as the process that refers itself to simplify a problem.
Ans. Recursion
42. ___ is a function that is associated with an optimization problem determining how
good a solution is.
Ans. Objective function
43. The running time needed to determine whether a possible value of a feasible solution is
O(n) and the time required to compute the objective function is also O(n) is ___.
Ans. O(n2n).
44. Selection sort is one of the simplest and ___ sorting techniques.
Ans. Performance-oriented
45. Bubble sort has ___, best and average case run-time of O(n2).
Ans. Worst
48. We program sequential search in an array by ___an index variable until it reaches the
last index.
Ans. Stepping up
49. In this pseudocode implementation, we execute the ___ only after all list items are
examined with none matching.
Ans. Last line
51. Exhaustive search algorithm gives the ___ for every candidate that is a solution to the
given instance P.
Ans. Output
52. Exhaustive search is typically used when the problem size is ___.
Ans. Limited
53. ___ need very few lines of code as it performs the same process again and again on
different data.
Ans. Recursive algorithms
54. In the towers of Hanoi problem, if the numbers of disks is n, the number of steps will
be___.
Ans. 2n-1
55. Unlike the merge sort, which breaks up its input elements according to their position in
the array, quick sort breaks them according to their ___.
Ans. Value
56. After the partition, if the pivot is inserted at the boundary between the ___ sub-arrays,
it will be in its final sorted position.
Ans. Left and right
57. Binary search is an algorithm for identifying the position of an element in a ___ array.
Ans. Sorted
58. Say if the following statement is true or false. To find a value in an unsorted array, we
need to scan through only half the elements of an array.
Ans. False
59. Say if the following statement is true or false. The benefit of binary search is that its
complexity depends on the array size logarithmically.
Ans. True
60. ___ methodology can solve most of the problems regarding binary trees.
Ans. Divide and Conquer
61. The three typical traversals: ___, ___, and ___ are the most important Divide and
Conquer algorithms of binary trees.
Ans. Pre-order, in-order, post-order
62. Two kinds of traversal are ___ and ___.
Ans. Breadth-first traversal, depth-first traversal
63. At the expense of a slight increase in the number of additions, the strassen’s matrix
multiplication algorithm will ___ the total number of multiplications performed.
Ans. Decrease
64. The normal method of matrix multiplication of two n X n matrices takes ___
operators.
Ans. O()
66. Mergesort is a perfect example of a successful application of the ___ and ___
methodology.
Ans. Divide, Conquer
69. If the array has two or more cells, the algorithm calls the ___ method.
Ans. Partition
71. ___, ___ & ___ are three instances of the transform and conquer technique.
Ans. Instance simplification, problem reduction, representation change
73. Decrease and conquer is a method by which we find a solution to a given problem
based upon the ___ of a number of problems.
Ans. Solution
75. In insertion sort, the best case input is an array that is already ___.
Ans. Sorted
Q. 1. Which Data Structure is used to perform Recursion?
A : Array
B : queue
C : stack
D : linked list
stack
Q. 12. Which data structure is used for implementing a FIFO branch and bound strategy?
A : Stack
B : Queue
C : Array
D : Linked List
Queue
O(N Log N)
Q. 14. q29.jpeg
A : 111
B : 101
C : 110
D : 11
110
Q. 17. Fractional knapsack problem is solved most efficiently by which of the following algorithm?
A : Divide And Conquer
B : Dynamic Programming
C : Greedy Algorithm
D : Backtracking
Greedy Algorithm
Q. 22. An algorithm that always runs in polynomial time but possibly returns erroneous answers is called a
…………
A : Las Vegas Algorithm
B : Monte Carlo Algorithm
C : Atlantic City Algorithm
D : Approximation algorithm
Q. 25. Choose the correct steps to prove if the vertex cover problem is NPComplete. I– Vertex Cover
problem is in NP II–Clique problem is in NP III–Prove that Clique problem ≤ Vertex Cover Problem
in polynomial time IV—Prove that Vertex Cover problem ≤ Clique Problem in polynomial time
A : I and III
B : I and IV
C : II and III
D : II and IV
I and III
Q. 26. Running the program many times is sufficient to prove the correctness of program
A : true
B : false
C:
D:
false
Q. 32. Which data structure has a better amortized running time than others?
A : Queue
B : Stack
C : Priority Queue
D : List
Priority Queue
Q. 33. Which of the following statement about 0 1 knapsack and fractional knapsack problem is
correct?
A : In 0 1 knapsack problem items are divisible and in fractional knapsack items are
indivisible
B : Both are the same
C : 0 1 knapsack is solved using a greedy algorithm and fractional knapsack is solved
using dynamic
programming
D : In 0 1 knapsack problem items are indivisible and in fractional knapsack items are
divisible
In 0 1 knapsack problem items are indivisible and in fractional knapsack items are divisible
Q. 34. Which data structure is most suitable for implementing best first branch and bound strategy?
A : Stack
B : Queue
C : Priority Queue
D : Linked List
Priority Queue
Q. 35. Time taken in decreasing the node value in a binomial heap is
A : O(n)
B : O(1)
C : O(log n)
D : O(n log n)
O(log n)
Q. 36. Multithreaded computation can be better understood with the help of a
A : Computation undirected acyclic graph
B : Computation directed cyclic graph
C : Computation directed acyclic graph
D : Computation undirected cyclic graph
Q. 38.
A : 10
B:1
C : 10 9 8 ……1 0
D : 10 9 8 ……1
10 9 8 ……1
Q. 39. What are desirable characteristics of Algorithm with efficiency 1)Generality 2) Availability 3)
Simplicity
A : 1 and 2
B : 2 and 3
C : 1 and 3
D:
1 and 3
Q. 40. we can refere to the common sense/ intution while specifing the
algorithm
A : true
B : false
C:
D:
false
Q. 41. What are requirements should a problem satisfy in order to be suitable for solving it by a
Genetic Algorithm?
A : The Fitness Function Cannot Be Well–Defined.
B : Solutions Should Be Decomposable Into Steps (Building Blocks) Which Could Be
Then Encoded As Chromosomes.
C : The Member Function Can Be Well–Defined.
D : Minimize Functions
Solutions Should Be Decomposable Into Steps (Building Blocks) Which Could Be Then Encoded As
Chromosomes.
Q. 42. What is the feature of ANNs due to which they can deal with noisy, fuzzy, inconsistent data?
A : Non Associative Nature Of Networks
B : Distributive Nature Of Networks
C : Non Distributive Nature Of Networks
D : Is A Meta Heuristic Search Method
Q. 43. Basic operations like insertion, look-up and removal in splay trees are performed in …….
time.
A : O(1)
B : O(n)
C : O(log n)
D : O(n log n)
O(log n)
Q. 44. Mathematical induction can be used to prove that, for any positive integer n, “Summation of
first 1 to n numbers ” is
A : n(n+1)/2
B : n^2(n+1)^2/2
C : n(n-1)/2
D:
n(n+1)/2
Q. 45. Which of the following methods can be used to solve the Knapsack problem?
A : Divide And Conquer
B : Sorting Algorithm
C : Monte-Carlo Algorithm
D : Brute Force, Recursion And Dynamic Programming
Brute Force, Recursion And Dynamic Programming
Q. 50. Find out one solution store it in solution set again find out another solution store in it solution
set, again find out the another solution store into the solution set, now from the solution set we find
out the best solution, which maybe best solution for optimal solution, this is which type of solution
strategy?
A : Dynamic programming
B : Greedy method
C : backtracking
D : Neither Dynamic Nor Greedy
Greedy method
Q. 54. What are the issues on which biological networks proves to be superior than AI networks?
A : Robustness & Fault Tolerance
B : Inflexibility
C : Single Computation
D : No Computation
Q. 57. Assertion is
A : statement that is true all the time
B : statement about state of program
C : statement describing program statement
D:
statement about state of program
Q. 58. what are the ways to remove the redundant computation outside the
loop
A : Code motion
B : frequency reduction
C : Strength reduction
D : All of these
All of these
Q. 59. If a problem can be broken into subproblems which are reused several times, the problem
possesses ____________ property.
A : Overlapping Subproblems
B : Optimal Substructure
C : Memoization
D : Greedy
Overlapping Subproblems
Q. 60. Given items I = (I1,I2,I3,I4,I5), w = (5, 10, 20, 30, 40) and v = (30, 20, 100, 90,160). The capacity
of knapsack W = 60. Find the maximum profit using fractional knapsack.
A : 250
B : 270
C : 290
D : 130
1. What is an algorithm?
A A flowchart
B A flowchart or pseudocode
C A decision
D Step by step instructions used to solve a problem
D