Unit VI DAA MCQs-merged
Unit VI DAA MCQs-merged
Unit VI DAA MCQs-merged
PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
A) dependent
B) independent
C) concurrent
D) non concurrent
Answer: B
B) Parallel loop
C) Nested loop
D) Both A & B
Answer: D
33. What is the time complexity of matrix multiplied recursively by Divide and Conquer
Method?
A. O(n)
B. O(n2)
C. O(n3)
D. O(n!)
Answer : C
34. What is the time complexity of matrix multiplied recursively by Strassen’s Method?
A. O(nlog7)
B. O(n2)
C. O(n3)
D. O(n!)
Answer : A
35. How many recursive calls are there in Recursive matrix multiplication by Strassen’s
Method?
A. 5
B. 7
C. 8
D. 4
Answer : B
36. What is the time complexity of the fastest known matrix multiplication algorithm?
A. O(nlog7)
B. O(n2.37)
C. O(n3)
D. O(n!)
Answer : B
A.
B.
C. (nlogn)
D. (logn)
Answer : A
38. What is the average case time complexity of standard merge sort?
A. O(n log n)
B. O(n2)
C. O(n2 logn)
D. O(n log n2)
Answer : A
41. Choose the incorrect statement about merge sort from the following?
A. It is a comparison based sort
B. It is an adaptive algorithm
C. It is not an in place algorithm
D. It is stable algorithm
Answer : B
Dr. D. Y. PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
44. A 1-D partitioning of a graph is a partitioning of its _____ such that each vertex and the
edges emanating from it are owned by one processor.
A. Edges
B. Vertices
C. Both
D. None
Answer :B
45. In 1-D partitioning the set of vertices owned by a processor is also called its
A. Local vertices
B. Global vertices
C. Available vertices
D. Local edges
Answer :A
46. Breadth First Search is equivalent to which of the traversal in the Binary Trees?
A. Pre-order Traversal
B. Post-order Traversal
C. Level-order Traversal
D. in-order Traversal
Answer : C
47. A 2-D (checkerboard) partitioning of a graph is a partitioning of its _____such that each
edge is owned by one processor.
A. Edges
B. Vertices
C. Edge and vertices
Dr. D. Y. PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
D. None
Answer : A
50. GHS is a distributed algorithm based on _______that constructs the minimum weight
spanning tree in a connected undirected graph with distinct edge weights.
A. Reverse-delete algorithm
B. Prims algorithm
C. Boruvka’s algorithm
D. Kruskal’s algorithm
Answer : D
51. In GHS algorithm for Minimum Spanning Tree (MST), an edge adjacent to the fragment
with smallest weight and that does not create a cycle is called as:
Answer : B
52. The GHS algorithm computes the minimum spanning tree using ___________messages
for a graph of N nodes and E edges
A. Atleast 2|E|
B. Atleast 5N logN
C. Atmost 3NlogN + 2|E|
D. Atmost 5N logN + 2|E|
Answer : D
Dr. D. Y. PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
54. In distributed minimum spanning tree node classifies the edges into which categories?
A. Branch
B. Basic
C. Reject
D. All of the above
Answer : D
57. Which of the following method is used for sorting in merge sort?
A. Merging
B. Partitioning
C. Selection
D. Exchanging
Answer : A
A. Trim sort
B. Intro sort
C. Bogo sort
D. Quick sort
Answer :A
Answer : A
61. GHS algorithm can construct the minimum spanning tree in ___________model.
Answer : D
64. Rabin Karp Algorithm makes use of elementary number theoretic notions.
a) True
b) False
Answer: a) True
65. What is the worst case running time of Rabin Karp Algorithm?
a) Theta(n)
b) Theta(n-m)
Dr. D. Y. PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c) Theta((n-m+1)m)
d) Theta(nlogm)
Answer: c) Theta((n-m+1)m)
Answer: a) Hashing
a)O(mn)
b) Big-Oh(n+m)
c) Theta(n-m)
d) Big-Oh(n)
Answer: a) O(mn)
68. If the expected number of valid shifts is small and modulus is larger than the length of
pattern what is the matching time of Rabin Karp Algorithm?
a) Theta(m)
b) Big-Oh(n+m)
c) Theta(n-m)
d) Big-Oh(n)
Answer: b) Big-Oh(n+m)
70. Given a pattern of length- 5 window, find the valid match in the given text.
Pattern: 2 1 9 3 6
Dr. D. Y. PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Modulus: 21
Index: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Text: 9 2 7 2 1 8 3 0 5 7 1 2 1 2 1 9 3 6 2 3 9 7
a)11-16
b)3-8
c)13-18
d) 15-20
Answer: c) 13-18
Explanation: The pattern 2 1 9 3 6 occurs in the text starting from position 13 to 18. In the
given pattern value is computed as 12 by having the modulus as 21. The same text string
values are computed for each possible position of a 5-length window.
71. Given a pattern of length- 5 window, find the spurious hit in the given text string.
Pattern: 3 1 4 1 5
Modulus: 13
Index: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Text: 2 3 5 9 0 2 3 1 4 1 5 2 6 7 3 9 9 2 1 3 9
a)6-10
b)12-16
c)3-7
d) 13-17
Answer: d) 13-17
Explanation: The sub string in the range 13-17, 6 7 3 9 9 produces the same value 7 as the
given pattern. But the pattern numbers don’t match with sub string identified, hence it is a
spurious hit.
a) Big-Oh(m*(n-m))
b) Big-Oh(n+m)
c) Theta(n-m)
d) Big-Oh(n)
Answer: a) Big-Oh(m*(n-m))
74. The time Complexity of Naïve Algorithm where pattern is not found is
a) Big-Oh(m*(n-m))
b) Big-Oh(n+m)
c) Theta(n-m)
d) Big-Oh(n)
Answer: a) Big-Oh(m*(n-m))
Answer: c) Both
78. In which string matching algorithm can the comparisons can be made in any order?
a) Naïve Algorithm
b) Rabin Karp Algorithm
c) Both of these
d) None of these
Dr. D. Y. PatilPratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to SavitribaiPhule Pune University
Sector No. 29, PCNTDA ,NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 SemII MCQs on Unit VI Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
79. Through how many places does Naïve Algorithm slides the pattern
a) One
b) Two
c) Three
d) Size of pattern
Answer: a) One
80. Rabin Karp Algorithm makes use of elementary number theoretic notions.
a) True
b) False
Answer: a) True
Explanation: Rabin Karp Algorithm makes use of elementary theoretic number notions such
as the equivalence of two numbers modulo a third number.
81. Rabin- Karp algorithm can be used for discovering plagiarism in a sentence.
a) True
b) False
Answer: a) True
83. What is the basic formula applied in Rabin Karp Algorithm to get the computation time as
Theta(m)?
a) Halving rule
b) Horner’s rule
c) Summation lemma
d) Cancellation lemma
1. ____ is used to measure the performance of the algorithm in the average case
A. Asypmtotic analysis
B. Discrete analysis
C. Amortized analysis
D. Time analysis
Answer : C
2. Which of the following are/is methods of amortized analysis
A. Accounting method
B. Aggregate analysis
C. Potential analysis
D. All the above
Answer : D
3. Which of the following method is taking overcharge for some operations in amortized analysis?
A. Aggregate method
B. accounting method
C. potential method
D. both (A) and (C)
Answer:B
A. Aggregate method
B. accounting method
C. potential method
D. both (A) and (B)
Answer:C
5. Which of the following method is taken different operations different charges in amortized analysis?
A. Aggregate method
B. accounting method
C. potential method
D. both (A) and (B)
Answer:B
6. Which of the following method is computing total cost of an algorithm in amortized analysis?
A. Aggregate method
B. accounting method
C. potential method
D. both (C) and (B)
Answer: A
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
7. which of the following method is credit as the potential energy to pay for future operations?
A. Aggregate method
B. accounting method
C. potential method
D. both (A) and (C)
Answer :C
8. In _____heap value of each node is greater than or equal than to its parent
A. Max heap
B. Bottom Heap
C. Average Heap
D. Min Heap
Answer : D
9. In _____heap value of each node is smaller than or equal than to its parent
A. Max heap
B. Bottom Heap
C. Average Heap
D. Min Heap
Answer : A
10. The best complexity of heapsort is
A. O(nlog2 n)
B. O(log2 n)
C. O(n2)
D. None of the above
Answer : A
11. Heap sort is an extremely stable algorithm.
A. True
B. False
Answer: A
Answer: A
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
15. The Statement “Fibonacci heap has better amortized running time in compare to a binomial heap”.
a) True
b) False
Answer :A
16. Fibonacci heap reduces the complexity of Dijkstra s shortest path algorithm to
A. O(N)
B. O(NlogN)
C. O(NlogN+M)
D. O(1)
Answer : C
17. Problems for which algorithm exists to solve problem in reasonable time
A. Non tractable problem
B. Tractable problem
C. Reduced problem
D. Complex problems
Answer:B
18. Problems for which no algorithm exists to solve problem in reasonable time
A. Non tractable problem
B. Tractable problem
C. Reduced problem
D. Complex problems
Answer:B
19. Las Vegas and Monte Carlo are categories of _________ algorithm
A. Approximation
B. Exponential
C. Randomized
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
D. Natural
Answer :C
20. A randomized algorithm uses random bits as input inorder to achieve a _____________ good
performance over all possible choice of random bits.
a) worst case
b) best case
c) average case
d) none of the above
Answer : C
21. A randomized algorithm uses random bits as input inorder to achieve a _____________ good
performance over all possible choice of random bits.
a) worst case
b) best case
c) average case
d) none of the above
Answer : D
22. In __________ algorithms optimal solution is reduced to feasible solution .
A.Randomized
B.Exponential
C.Natural
D .Approximation
Answer :D
23. ___________tree is a self adjusting binary search tree organized in a way such that recently accessed
elements can be accessed again quickly
A. complete
B.Skewed
C.Splay
D .Extended
Answer :C
24. Vertex cover problem is .
A. Randomization problem
B. Approximation problem
C. Exponential problem
D. None of the above
Answer : B
25. Approximation ratio P(n) of approximation algorithm is given by. (here C* is optimal solution C is
cost returned by approximation algorithm.)
A. Max(C/C*,C*/C)<=P(n)
B. Max(C*/C ,C/C*) >=P(n)
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
C. Max(C/C*,C*/C) >=P(n)
D. Max(C*/C ,C/C*) <=P(n)
Answer :A
26. The number of trees in a binomial heap with n nodes is
E. logn
F. n
G. nlogn
H. n/2
Answer : A
27. In a binomial heap the root value is greater than left child and less than right child
E. True
F. False
Answer : B
28. What is the order of resultant heap after merging two trees of order k?
A. 2*k
B. k+1
C. k*k
D. k+logk
Answer : B
29. Time taken in decreasing the node value in a binomial heap is
E. O(n)
F. O(1)
G. O(logn)
H. O(nlogn)
Answer : C
30. What does this pseudo code return?
int myfun(heap_arr[])
{
int mini=INF;
for(int i=0; <tot_node;i++)
mini=min(mini,heap_arr)
return mini;
}
A. Last element added to heap
B. First element added to heap
C. Root of the heap
D. Leftmost node of the heap
Answer : C
31. Which of these operations have same complexities?
E. Insertion, Find-min
F. Find_min, union
G. Union, Insertion
H. Deletion, Find_max
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Answer: C
32. Given a heap of n nodes. The maximum number of tree for building the heap is
E. n
F. n-1
G. n/2
H. logn
Answer: A
33. Choose the option with function having same complexity for a Fibonacci heap.
A. Insertion, Union
B. Insertion ,Deletion
C. extract_min, insertion
D. Union, Deletion
Answer: A
34. The main distinguishable characteristic of a binomial heap from a binary heap is that
E. It allows union operations very efficiently
F. It doesn’t allow union operations that could easily be implemented in binary heap
G. The heap structure is not similar to complete binary tree
H. The location of child node could be at level (h-2) or (h-3), where h is height of heap and
h>4
Answer : A
35. Dijkstra’s algorithm is used to solve
E. All pair shortest path
F. Single source shortest path
G. Network flow
H. Sorting
Answer : B
36. Which of the following is the most commonly used data structure for implementing Dijkstra’s
algorithm?
A. Max priority queue
B. Stack
C. Circular queue
D. Min priority queue
Answer : D
37. What is the time complexity of Dijkstra’s algorithm?
E. O(N)
F. O(N^3)
G. O(N^2)
H. O(logN)
Answer : C
38. Dijkstra’s algorithm cannot be applied on
E. Directed and weighted graphs
F. Graphs having negative weight function
G. Unweighted graphs
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
E. 8
F. 9
G. 4
H. 6
Answer : D
46. In the given graph:
Identify the shortest path having minimum cost to reach vertex e if a is the source vertex
A. a-b-e
B. a-c-e
C. a-c-d-e
D. a-c-d-b-e
Answer : B
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
8. How many conditions have to be met if an NP- complete problem is polynomially reducible?
A. 1
B. 2
C. 3
D. 4
Answer : B
9. To which of the following class does a CNF-satisfiability problem belong?
A. NP class
B. P class
C. NP complete
D. NP hard
Answer : C
10. Which of the following problems is not NP complete?
A. Hamiltonian circuit
B. Bin packing
C. Partition problem
D. Halting problem
Answer : D
11. The choice of polynomial class has led to the development of an extensive theory called
________
A. Computational complexity
B. Time complexity
C. Problem complexity
D. Decision complexity
Answer : A
12. To measure Time complexity of an algorithm Big O notation is used which:
A. Describes limiting behaviour of the function
B. Characterises a function based on growth of function
C. Upper bound on growth rate of the function
D. All of the mentioned
Answer : D
13. If for an algorithm time complexity is given by O(1) then complexityof it is:
A. Constant
B. Polynomial
C. Exponential
D. None of the mentioned
Answer : A
14. If for an algorithm time complexity is given by O(n) then complexityof it is:
A. Constant
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
B. Linear
C. Exponential
D. None of the mentioned
Answer : B
15. If for an algorithm time complexity is given by O((3⁄2)n) then complexity will:
A. Constant
B. Linear
C. Exponential
D. none of the mentioned
Answer : C
16. Upper bound is denoted as:
A. Ω
B. Θ
C. ꙍ
D. O
Answer : D
17. Lower bound is deonted as:
A. Ω
B. Θ
C. ꙍ
D. O
Answer : A
18. Which of the following case does not exist in complexity theory?
A. Best case
B. Worst case
C. Average case
D. Null case
Answer : D
19. The complexity of linear search algorithm is
A. O(n)
B. O(log n)
C. O(n2)
D. O(n log n)
Answer : A
20. The Worst case occur in linear search algorithm when
A. Item is somewhere in the middle of the array
B. Item is not in the array at all
C. Item is the last element in the array
D. Item is the last element in the array or is not there at all
Answer : D
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
C. O(x2 / 3)
D. O(1)
Answer : A
28. The big-Omega notation for f(x) = 2x4 + x2 – 4 is
A. X2
B. X3
C. x
D. x4
Answer : D
A. True
B. False
Answer : B
35. The complexity of merge sort algorithm is
A. O(n)
B. O(log n)
C. O(n2)
D. O(n log n)
Answer : D
1. The worst-case efficiency of solving a problem in polynomial time is?
a) O(p(n))
b) O(p( n log n))
c) O(p(n2))
d) O(p(m log n))
Ans : a
Ans : b
Ans : a
Ans : a
a) tractable problems
b) intractable problems
c) undecidable problems
d) decidable problems
Ans : c
Ans : d
Ans : a
Ans : b
Ans : b
a) true
b) false
Ans : a
11. How many conditions have to be met if an NP- complete problem is polynomially reducible?
a) 1
b) 2
c) 3
d) 4
Ans : b
Ans : c
13. How many steps are required to prove that a decision problem is NP complete?
a) 1
b) 2
c) 3
d) 4
Ans : b
Ans : d
15. The choice of polynomial class has led to the development of an extensive theory called
________
a) computational complexity
b) time complexity
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c) problem complexity
d) decision complexity
Ans : a
Ans : b
Ans : a
Ans : d
Ans : d
Ans : c
Ans : d
Ans : c
Ans : d
24. Certain problems may not be solved, such problems are called
a) non tractable problem
b) polynomial problem
c) tractable problem
d) both b and c
Ans : a
25. What are the problems that cannot be solved in polynomial time
a) Hamiltonian cycle
b) TSP
c) Tower of Hanoi
d) all of the above
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Ans : d
Ans : b
Ans : a
Ans : a
Ans : d
30. In terms of NTIME, NP problems are the set of decision problems which can be solved using
a non deterministic machine in _______ time.
a) O(n)
b) O(n1/2)
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c) O(nk), k∈N
d) None of the mentioned
Ans : c
Ans : c
Ans : d
6. The choice of polynomial class has led to the development of an extensive theory called…
A. Computational complexity
B. Time complexity
C. Space complexity
D. None of the above
Answer :A
7. A problem which is both______ and ________ is said to be NP-Complete
A. NP,P
B. NP,NP-hard
C. P,P-complete
D. None
Answer : A
8. For which of the following, greedy algo finds a minimal vertex cover in polynomial time?
A. Bipartite graphs
B. Tree graphs
C. both
D. none
Answer :B
10. If the number of steps required to solve a problem is O(n^k) then the problem is
A. Non-polynomial time
B. Polynomial time
C. Infinite time
D. none
Answer :B
12. Ram and Shyam have been asked to show that a certain problem P’ is NP-Complete. Ram
shows a polynomial time reduction from the 3sat problem to P’, and shyam shows a polynomial
time reduction from P’ to 3sat. what can be inferred from these reductions?
15. Let S be an NP-complete problem and Q and R be two other problems not known to be in
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
NP. Q is polynomial time reducible to S and S is polynomial time reducible to R. Which of the
following is true?
A. R is NP-complete
B. R is NP-hard
C. Q is NP-complete
D. Q is NP-hard
Answer : B
17. For problems X and Y, Y is NP_complete and X reduces to Y in polynomial time. Which of
the following is true?
A. If X can be solved in polynomial time, then so can Y
B. X is NP-complete
C. X is NP-hard
D. X is in NP but not necessarily NP-complete
Answer :D
19. If we convert one problem A into problem B (NP problem) then A is _______ to B.
A. Extended
B. Reducible
C. Tractable
D. Not tractable
Answer :B
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit V Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
21. We start with a sub-optimal solution and the solution is improved repeatedly until some
condition is maximized. This is called as
A. Hill Climbing
B. Maximizing
C. Up-hill
D. NOne
Answer :A
1. Greedy algorithm does not work ___ and finds ____ solution.
a) iteratively,optimal
b) parallely,no optimal
c)parallely,optimal
d) iteratively,no optimal
Answer: c
2. Every finite subset of a non-regular set is____
a) finite
b)regular
c) infinte
d) non-regular
Answer: b
3. Given a set of items n ,each with a weight w and profit p ,using fractional knapsack
determine the total Profit such that the total weight is equal to a given knapsack limit M and
the total Profit is maximum n = 3, M = 20, (p 1 , p 2 , p 3 ) = (25, 24, 15) , (w 1 , w 2 , w 3 ) =
(18, 15, 10).
a) 24
b) 24.5
c) 31
d)31.5
Answer: d
4. The measurement of time factor while determining the algorithm’s efficiency is done by
counting the number of ___
a) statements
b) kilobytes
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c)operations
d)microseconds
Answer: c
5. Which algorithm can solve Knapsack problem most efficiently?
a)Dynamic Programming
b)Greedy Algorithm
c)Divide and Conquer
d)All of the above.
Answer: b
6. An algorithm takes ___ time to determine optimal load, such that number of objects are n
and capacity is w for 0/1 Knapsack problem.
a. O(n+w)
b. O(nw)
c. O(n)
d. None of these
Answer: a
7. Activity selection problem is to select a maximum-size set of ____
a)mutually comparable activities
b)mutually compatible activities
c)mutually reversible activities
d)mutually distinct activities
Answer: b
8. Suppose the letters a, b, c, d, e, f have probabilities 1/2, 1/4, 1/8, 1/16, 1/32, 1/32
respectively. What is the average length of Huffman codes?
a) 3
b) 2.1875
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c) 2.25
d)1.9375
Answer: d
9. A choice made in Greedy algorithm must be
a. Feasible
b. locally optimal
c. irrevocable
d. All of these
Answer: d
10. Determine the Jobs scheduled for obtaining optimal job sequence for following jobs where
n=5, (p1,p2,p3,p4,p5) = (25,15,12,5,1) and (d1,d2,d3,d4,d5) =(3,2,1,3,3)
a. J1,J3,J4, J5
b. J1,J2,J4
c. J1,J2,J3
d. J1,J2,J3, J5
Answer: c
11. Determine the Profit for optimal job sequence for following jobs where n=5,
(p1,p2,p3,p4,p5) = (25,15,12,5,1) and (d1,d2,d3,d4,d5) =(3,2,1,3,3)
a. 42
b. 44
c.52
d.54
Answer: c
12. Which statement is correct about Prim’s algorithm.
i) It is a greedy approach to find a MST from a weighted graph.
ii) It is a variation of Dijkstra’s algorithm
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
a. (i)
b. (ii)
c. both
d. none
Answer: c
13. Prim’s algorithm is preferred when graph is dense with V__E.
a. <<
b. >>
c. <=
d. >=
Answer: a
14. In Prim’s algorithm,with |V| as vertices and |E| as edges, the time complexity of O(n2) can
be reduced by binary heap and adjacency list to
a. O(|V|log|E|)
b. O(|E|log|V|)
c. O(|E|+|V|log|V|)
d. O(|E|+|V|log|E|)
Answer: b
15. The minimum distance path from 1-7 by Dijkstra’s algorithm for this MST would be
a. 1-2-3-4-7
b. 1-4-7
c. 1-2-3-5-7
d.1-6-7
Answer: c
16. MST is not used in__
a. network design
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
b. routing algorithm
c. Travelling Salesman problem
d. none of these
Answer: d
17. Using Binary Knapsack algorithm by greedy method ,the number of items selected where
the solution is optimal for no. of objects n=5,capacity M=100,profit V=(10,20,30,40,50),
weights W=(20,30,66,40,60).
a. 3
b. 4
c. 2
d. 1
Answer: c
18. Knapsack problem is formulated as i=1Σn pixi subjected to i=1Σ
n
wixi ___M.
a. <=
b. >=
c. =
d. none of the above
Answer: a
19. Determine the Jobs scheduled for obtaining optimal job sequence for following jobs where
n=7, (p1,p2,p3,p4,p5,p6,p7) = (3,5,20,18,1,6,30) and (d1,d2,d3,d4,d5,d6,d7) =(1,3,4,3,2,1,2)
a. J1,J5,J6, J7
b. J7,J6,J4, J3
c. J1,J6,J4, J7
d. J7,J6,J3, J5
Answer: b
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
20. The process by an operating system (OS) of allocating many different tasks to system
resources is called as ____
a. Job scheduling
b. Multitasking
c. Distribution
d. None of these.
Answer: a
21. The time complexity of the_____ is O(nlogn) using greedy algorithm.
a. Job scheduling
b. Huffman algorithm
c. Dijkstra's problem
d. Travelling Salesman problem
Answer: b
22. Using Kruskal’s algorithm the selected paths of MST
of the given graph would be ____
a. 1-2,2-3,3-4,4-5
b.1-2,1-3,3-4,3-5
c. 1-2,2-4,3-4,4-5
d. None of these.
Answer: b
23. Using Kruskal’s algorithm the cost of MST of the
above graph would be ____
a. 8
b.15
c. 10
d. 7
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Answer: c
24. Application of Greedy Approach ____
a. Knapsack problem
b. Activity selection
c. Both
d. None of these
Answer: c
25. Greedy algorithm works by recursively breaking down a problem into two or more sub-
problems of the same or related type to solve independently and solutions are combined to
gain the main solution.
State true or false
a. true
b. false
c. inadequate information
d. cannot be determined.
Answer: b
26. _______ guarantees optimal solution when algorithm halts.
a. Binary Knapsack problem
b. Fractional knapsack problem
c. Both
d. None of these
Answer: b
27. For the characters (A,B,C,D,E,F) with relative frequencies (0.5,0.35,0.5,0.1,0.4,0.2) find
Huffman code for text DAD.
a. 1101101101
b. 10110010
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c. 11110111
d. 1100101100
Answer: d
28. From the following tree what would be Huffman code for b?
a. 011
b. 010
c. 100
d.101
Answer: b
29. Using Prim’s algorithm the selected paths of MST of the given
graph would be ____
a. a-b,b-c,c-d,d-f,f-e
b. a-e,a-b,b-c,c-d,d-f
c. a-b,b-c,c-f,d-f,f-e
d. a-f,f-b,b-c,c-d,f-e
Answer: c
30. Using Prim’s algorithm the cost of MST of the above graph would be ____
a. 8
b. 15
c. 10
d. 7
Answer: b
1. Branch and Bound usually applies to those problems that have ___
a) finite solutions
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
b) infinite solutions
c) both a &b
d) cannot be determined
Answer: a
2. Branch and Bound is used to solve ___
a) decision problems
b) optimization problem
d) both a & c
Answer: b
3. Brach and bound algorithms handle the problem by ___ and ___.
a) LIFO or FIFO
b) bounding and pruning
c) both a & b
d) none of these
Answer: b
4. Branch and Bound time complexity is less compared to other algorithms.
a. True
b. False
c. cannot be determined
d. None of these
Answer: a
5. Branch and bound algorithms is limited to small size network.
a. True
b. False
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
c. cannot be determined
d. None of these
Answer: a
6. Evolutionary computation is a general name for a group of problem-solving techniques
whose principles are based on the ___.
a. theory of biological evolution
b. genetic inheritance
c. natural selection
d. all of the above
Answer: d
7. Evolutionary computation is used to solve problems that have too many ___ for ___.
a. variables, traditional algorithms
b. techniques, Genetic algorithms
c. strategies, Evolutionary programming
d. none
Answer: a
8. Branch and Bound finds the minimum path instead of finding the minimum successor so
there should not be any repetition.
a. True
b. False
c. cannot be determined
d. None of these
Answer: a
9. Bounding and purning are the essential concepts of the branch and bound technique
,because they are used to effectively reduce the ___.
a. search space
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
b. memory space
c. execution speed
d. none of these
Answer: a
10. what are the basic types of evolutionary algorithms ___.
a. Genetic algorithms
b. Evolutionary programming
c. Evolutionary strategies
d. all of the above
Answer: d
11. The load balancing aspects for Branch and Bound algorithm make it parallelization easy.
a. True
b. False
c. inadequate information
d. None of these
Answer: b
12. The population will contain an arbitrary number of possible solutions to the problem,
oftentimes called ___.
a. context
b. selection
c. initalization
d. members
Answer: d
13. Better optimization is possible with evolutionary algorithms.
a. True
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
b. False
c. cannot be determined
d. None of these
Answer: a
a. True
b. False
c. inadequate information
d. None of these
Answer: a
18. Bounding functions are used to ____ that do not contain an answer node.
a. computing the node
b. exploring new node
c. avoid the generation of subtrees.
d. all of the above
Answer: c
19. Genetic Algorithm (GA) is a search-based optimization technique based on the principles
of ____ .
a. Evolutionary Computation
b. Evolutionary strategies
c. Genetics and Natural Selection
d. Evolutionary algorithms
Answer: c
20. Executing recombination and mutation leads to new set of candidates based on their
fitness. This is a ____ of new candidate.
a. mutation
b. recombination
c. context
d. none of these.
Answer: d
21. Genetic algorithms are based on the ideas of _______ and _______.
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , Nigidi Pradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit III Year: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Answer: B
8. Shrinking phase of recursion involves the
A. Recursive calls
B. No recursive calls
C. Both A and B
D. None of the above
Answer: B
9. In tail recursion,____
A. Recursive call is not involved.
B. Recursive call is passed as an argument.
C. Computation is done later after passing value to recursive call
D. Computation is done first and then value is passed to recursive call
Answer :D
10. The tail recursion does not need to save
A. Previous data
B. Current data
C. Both A and B
D. None of the above
Answer : A
11. Stack overflow does not occur in
A. Tail recursion
B. Binary recursion
C. Iterative recursion
D. Nested Recursion
Answer :A
12. These determines visibility and accessibility
A. Scope rules
B. Block rules
C. Bound rules
D. Access rules
Answer : A
13. Consider
Sum_range(a,b)
For i<-- a to b do
Sum <--sum+ i;
End
Which of the following is free variable?
A. a
B. b
C. i
D. Both a and b
Answer :D
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
14. Consider
Sum_range(a,b)
For i<-- a to b do
Sum <--sum+ i;
End
Which of the following is free variable?
A. a
B. b
C. i
D. Both a and b
Answer :C
15. For correctness of the algorithm of iterative process arrange the following in order
1. Maintainence
2. Initialization
3. Termination
A. 1 3 2
B. 3 2 1
C. 2 1 3
D. 1 2 3
Answer : C
16. Imperative model is
a. Object Oriented Model
b. Structured Programming Model
c. Declarative Model
d. Imperative Model
Answer : B
17. State changes is exist in
A.Descriptive model
B.Declarative model
C.Imperative model
D .Object Oriented model
Answer :B
18. Which model serve as specification for Imperative model
A.Descriptive model
B.Declarative model
C.Functional model
D .Object Oriented model
Answer :C
19. Stepwise Refinement is a ________approach.
A. Bottom up
B. Top down
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
C. Both A and B
D. None of the above
Answer : B
20. ______is the progressive refinement in small steps of a program specification.
A. Stepwise refinement
B. Blockwise Refinement
C. Statewise Refinement
D. None of the above
Answer :A
21. Which of the following is exit controlled loop
Fig . 1 Fig . 2
A. Fig 1
B. Fig 2
C. Neither 1 nor 2
D. Both 1 and 2
Answer : B
22. Model which focusses on how to perform task and how to track changes in state
A.Descriptive model
B.Declarative model
C.Imperative model
D .Object Oriented model
Answer :C
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
B. SQL,HTML
C. Both A and B
D. None of the above
Answer :A
A. If P is precondition for S to produce result R, and If there is any assertion R implies Q then P is post
condition for S to produce output Q.
B. If P is precondition for S to produce result R, and If there is any assertion R implies Q then P is pre-
condition for S to produce output Q
C. If P is postcondition for S to produce result R, and If there is any assertion R implies Q then P is post
condition for S to produce output Q
D. None of these
Answer : B
4. {P} S {R}, R => Q / {P] S {Q} and P => R, {R} S {Q} / {P} S {Q} are known as
A. Inference Rules
B.
C. Consequence Rules
D. None of these
Answer : C
5. Which language follows Simple Counting Type for loop?
A. JAVA
B. PASCAL
C. C
D. C++
Answer : B
6. Which language follows simple General for loop?
A. C++
B. BASIC
C. JAVA
D. Both A and C
Answer : D
7. Let P(w) denote some valid assertion about the range w. Then we assume that the statement S sat-
isfies the following: {P( [a … x) )}S{P( [a … x] )} for all x, a ≤ x ≤ b. Thus the proof rule for the counting For
loop is:
A.
B.
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
C.
D.
Answer : A
[S]
S1;
[{S}S1{P}]
while B1 do
[Ρ∧Β1]
S2;
[{Ρ∧Β1}S2{R}]
if B2 then
[R∧Β2]
break;
end
[R∧—Β2]
S3;
[{R∧¬Β2} S3 {T}]
if B3 then
[Τ∧Β3]
continue;
end
[Τ∧¬Β3]
S4;
[{ Τ∧¬Β3} S4{P}]
End
Thus the proof rule is
A.
B.
C.
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
D. None of these
9. Pascal is based on
A. sequential programming
B. procedural programming
C. structural language
D. object oriented language
Answer : C
10. In C and C++, termed used for a subprogram is termed as
A. subroutine
B. function
C. procedure
D. string
Answer : B
11. In object oriented programming, function parameters are also known as
A. complex parameters
B. formal parameters
C. loop parameters
D. loop parameters
Answer : B
12. Function which is used in stepwise refinement of program is classified
A. Routine format
B. Library format
C. Subroutine format
D. Procedure
Answer : D
13. Which of the following is true about return type of functions in C?
A. Functions can return any type
B. Functions can return any type except array and functions
C. Functions can return any type except array, functions and union
D. Functions can return any type except array, functions, function pointer and union
Answer : B
14. A program should be
A. Secure
B. Sequential
C. Ordered
D. Simple
Answer : B
15. ______ is a condition that is always true at a perticular point in an algorithm
A. assertion
B. constant
C. exception
D. Invariant
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Answer : D
16. The correctness and appropriateness of ___________solution can be checked very easily.
A. algorithmic solution
B. heuristic solution
C. random solution
D. none of these
Answer : A
17. For an algorithm which is most important characteristic that makes it acceptable:
A. Fast
B. Compact
C. Correctness and Precision
D. None of the mentioned
Answer : C
18. Mechanism used to convey information to functions is the
A. Commands
B. Arguments
C. Loops
D. Statements
Answer : B
19. Which of the following statement cause program control to end up almost anywhere in the pro-
gram
A. Go to
B. For
C. Do while
D. While
Answer : A
20. Structured program can be easily broken into routines or ________ that can be assigned to any
number of programmers
A. Segments
B. Modules
C. Units
D. Sequences
Answer : B
21. Goto statement is
A. Used to jump the control of program
Dr. D. Y. Patil Pratishthan’s
DR. D. Y. PATIL INSTITUTE OF ENGINEERING, MANAGEMENT & RESEARCH
Approved by A.I.C.T.E, New Delhi , Maharashtra State Government, Affiliated to Savitribai Phule Pune University
Sector No. 29, PCNTDA , NigidiPradhikaran, Akurdi, Pune 411044. Phone: 020–27654470, Fax: 020-27656566
Website : www.dypiemr.ac.in Email : principal@dypiemr.ac.in
Academic Year: 2019-20 Sem II MCQs on Unit IIYear: TE
Subject: Design and Analysis of Algorithms Subject Code:310250
Ans- b
Ans-b
b. Quick sort
c. Merge sort
d. Selection sort
ans – d
4. From the following sorting algorithms which has the lowest worst case complexity?
a. Bubble sort
b. Quick sort
c. Merge sort
d. Selection sort
ans-c
a. Natural language
b.pseudo code
c.flowcart
a. Natural language
b. pseudo code
c. Flowchart
ans - a
a. Natural language
b. pseudo code
c. Flowchart
ans- c
a. Natural language
b. pseudo code
c. Flowchart
ans-b
a. True
b. False
ans- a
b. logn
c. n^2
ans- a
a. nlogn
b. logn
c. n^2
ans-b
b. Complexity theories
c. computational theory
ans- b
13. Structural programming came into existence after ___________ introduced the idea of
Effective Procedure in 1936.
a. Donald Knuth
b. Barbarians
c. Alan Turing
ans- c
b. false
ans- a
a. tractable problems
ans- b
16. Statement –“Any program is an algorithm but the reverse is not true.”
a. true
b. false
ans - a
b. interpolating addresses
ans – d
18. _____ uses standard setoff symbols to represent the flow of operations.
a. Natural language
b. pseudo code
c. Flowchart
ans- c
19. It is the time taken by the algorithm to solve the given problem:
a. Space complexity
b. Time complexity
c. Computational complexity
d. None
20. It is the amount of memory required by the algorithm to solve the given problem:
a. Space complexity
b. Time complexity
c. Computational complexity
d. None
ans-b
21. Provides a suboptimal to solution to the problems like Huffman code, minimal spanning tree
etc.
b. linear programming
c. greedy method
d. sorting
ans- c
22. Efficiency of the algorithm is measured by the execution time of the algorithm.
a. true
b. false
ans- a
a. tractable problems
b. non- tractable
c. NP complete
d. none
ans- c
24. The space factor when determining the efficiency of algorithm is measured by
25. Which of the following case does not exist in complexity theory?
A. Best case
B. Worst case
C. Average cas=
D. Null case
Ans -d