You are on page 1of 73

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

1.What is multithreaded programming?


A) It’s a process in which two different processes run simultaneously
B) It’s a process in which two or more parts of same process run simultaneously
C) It’s a process in which many different process are able to access same information
D) It’s a process in which a single process can access information from many sources
Answer : B

2. Which of the following is not a performance measure?


A) Work
B) slackness
C) speedup
D) none of these
Answer : D

3. Which keywords indicates that iterations of loop may run concurrently?


A) parallel
B) parallel for
C) spawn
D) sync
Answer: B

4. The ratio for perfect linear speedup?


A) T1/Tp=(Theta)P
B) T1/Tp=P
C) T1/T(infinity)
D) None of these
Answer: B

5.Which of these keywords is used to parallelise loops


A) spawn
B) sync
C) Both A & B
D) None of these
Answer : C

6.Modes of communication in parallel computing


A) Shared memory
B) Distributed memory
C) Both A & B
D) None of these
Answer: C
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

7.How many types of algorithms are there in multithreading


A) 2
B) 3
C)4
D) 5
Answer : A

8.Parallel loops can be implemented using


A) Branch & Bound
B) Divide & conquer
C) Greedy
D) None of these
Answer : B

9.In comparison with processes thread operates


A) faster
B) slower
C) same
D) moderate
Answer: A

10.Non deterministic algorithms gives _____ output on different runs


A) same
B) different
C) None of these
Answer: B

11.Parallelism is the ratio of


A) Work to Slackness
B) Slackness to work
C) Work to Span
D) Span to work
Answer: C

12.Deterministic algorithm gives ____ output for different input


A) same
B) different
C) None of these
Answer : A

13.Instructions in the strand are


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

A) dependent
B) independent
C) concurrent
D) non concurrent
Answer: B

14.Ways in which race condition can be handled


A) mutual condition
B) semaphore
C) Both A & B
D) None of these
Answer: C

15.Nested parallelism is introduced by______ keyword


A) sync
B) for
C) parallel
D) spawn
Answer : D

16.Parallel computing is achieved through _____ threading


A) dynamic
B) static
C) Both A & B
D) None of these
Answer: B

17.Which command prevents returning value


A) spawn
B) sync
C) Both A & B
D) None of these
Answer : B

18.Race condition happens where


A) It access same memory & one performs a write
B) It access same memory
C) It access different memory
D) It access different memory & one performs a write
Answer: A

19.Features of dynamic threading


A) Nested parallelism
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

B) Parallel loop
C) Nested loop
D) Both A & B
Answer: D

20.The operation of thread controlled by the user is


A)insertion
B) deletion
C) updation
D) searching
Answer: B

21.Execution of each thread is


A) dependent
B) independent
C) Both A & B
D) None of these
Answer: B

22.Speedup of computation diverges further from perfect speedup if


A) Slackness > 1
B) Slackness <1
C) Slackness = 1
D) None of these
Answer: B

23.Work law is defined as


A) Tp >=T1(P)
B) Tp <=T1(P)
C) Tp =T1(P)
D) Tp !=T1(P)
Answer: A

24.parallel for keyword indicates


A) iterations of loop may run concurrently
B) iterations of loop may run independently
C)iterations of loop may run dependently
D) None of these
Answer: A

25.Two metrics by which efficiency of multithreading algorithm is measured


A) Slackness & span
B) Work & span
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) Work & Slackness


D) Both A & B
Answer: B

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

37. The span of below algorithm is


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

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

39. What is the auxiliary space complexity of merge sort?


A. O(1)
B. O(n logn)
C. O(n)
D. O(N2)
Answer : C

40. What is the worst case time complexity of 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

42. In distributed systems, a logical clock is associated with ______________


A. Each instruction
B. Each process
C. Each register
D. None
Answer : B

43. communication cost in distributed algorithm is ____as compared to parallel algorithm.


A. Less
B. More
C. Equal
D. Very less
Answer : B

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

48. communication cost in 2D partitioning is ____as compared to1D partitioning.


A. Less
B. More
C. Very less
D. None
Answer : A

49. GHS(Gallager Humblet and Spira) is one of the most popular


A. Parallel MST algorithm
B. Sequential MST algorithm
C. Distributed MST algorithm
D. None
Answer : C

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:

A. Weight outgoing edge (WOE)


B. Minimum weight outgoing edge (MWOE)
C. Least weight outgoing edge (LWOE)
D. Link outgoing weight edge (LOWE)

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

53. Which of the Precondition must satisfied for GHS algorithm


A. Algorithm should run on a connected undirected graph
B. Algorithm should have distinct finite weights assigned to each edge
C. Each edge delivers message in FIFO order.
D. All of the above
Answer : D

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

55. The travelling salesman problem can be solved using _________


A. A spanning tree
B. A minimum spanning tree
C. Bellman-ford algorithm
D. DFS Traversal
Answer : B

56. Which of the following is false?


A. The spanning trees do not have any cycles
B. MST have n – 1 edges if the graph has n edges
C. Edge e belonging to a cut of the graph if has the weight smaller than any other
edge in the same cut, then the edge e is present in all the MSTs of the graph
D. Removing one edge from the spanning tree will not make the graph
disconnected
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

58. Which of the following is not a variant of merge sort?


A. in-place merge sort
B. bottom up merge sort
C. top down merge sort
D. Linear merge sort
Answer : D
59. Which of the following sorting algorithm makes use of merge sort?
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

A. Trim sort
B. Intro sort
C. Bogo sort
D. Quick sort
Answer :A

60. Is Coppersmith-Winograd algorithm better than Strassen’s algorithm in terms of time


complexity?
A. True
B. False

Answer : A

61. GHS algorithm can construct the minimum spanning tree in ___________model.

A. Synchronous message passing


B. Asynchronous message passing
Answer : B

62. In distributed MST combining fragment operates in_____time.


A. O(log|V|)
B. O(|V|)
C. O(|V2|)
D. O(|V| log|V|)

Answer : D

63. What is a Rabin and Karp Algorithm?


a) String Matching Algorithm
b) Shortest Path Algorithm
c) Minimum spanning tree Algorithm
d) Approximation Algorithm

Answer: a) String Matching Algorithm

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)

66. What is the basic principle in Rabin Karp algorithm?


a) Hashing
b) Sorting
c) Augmenting
d) Dynamic Programming

Answer: a) Hashing

67. The worst case complexity of Rabin Karp is?

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)

69. What is spurious hit?

a) When pattern of strings is matched


b) When pattern of strings is not matched
c) Any of the above
d) None of the above

Answer: b) When pattern of strings is not matched

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.

72. Naïve String Matching Algorithm uses which principle?


a)Hashing
b)Brute force
c) Sorting
d) Dynamic Programming

Answer: b)Brute force

73. The time Complexity of Naïve Algorithm where pattern is found is


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

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))

75. Which algorithm slides the pattern one by one?


a)Rabin Karp Algo
b)Naïve Algorithm
c)Both
d)None of these

Answer: c) Both

76. What is string matching?


a) Finding first occurrence of pattern in given text
b) Finding the last occurrence of pattern in given text
c) Finding number of occurrences

Answer: a) Finding all occurrences of a pattern is a given text

77. Where is string matching used?


a) Text Editor
b) Matching username and password
c) Virus detection
d) Header analysis in data communication
e) All of the above

Answer: e) All of the above

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

Answer: a) Naïve Algorithm

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

82. Who created the Rabin Karp Algorithm?


a) Joseph Rabin and Michael Karp
b) Michael Rabin and Joseph Karp
c) Richard Karp and Michael Rabin
d) Michael Karp and Richard Rabin

Answer: c) Richard Karp and Michael Rabin

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

Answer: b) Horner’s rule

84. What happens when the modulo value(q) is taken large?


a) Complexity increases
b) Spurious hits occur frequently
c) Cost of extra checking is low
d) Matching time increases
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

Answer: c) Cost of extra checking is low


Explanation: If the modulo value(q) is large enough then the spurious hits occur infrequent-
ly enough that the cost of extra checking is low.
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

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

4. Which of the following method is most flexible in amortized analysis?

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

12. In what time can a binary heap be built?


A. O(N)
B. O(N log N)
C. O(log N)
D. O(N2)

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

13. Binomial tree of order k has ______nodes


A. 2k
B. 2k-1
C. 2k+1
D. 2
Answer :A

14. Binomial Heap satisfy ________property


A. Max heap property
B. Min heap property
C. Both A and B
D. None of the above
Answer : B

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

H. Undirected and unweighted graphs


Answer : B
39. How many priority queue operations are involved in Dijkstra’s algorithm?
A. 1
B. 3
C. 2
D. 4
Answer : B
40. How many times the insert and extract min operations are invoked per vertex?
A. 1
B. 2
C. 3
D. 0
Answer: A
41. The maximum number of times the decrease key operation performed in Dijkstra’s algorithm will be
equal to
A. Total number of vertices
B. Total number of edges
C. Number of vertices - 1
D. Number of edges -1
Answer: B
42. What is the running time of Dijkstra’s Algorithm using binary min-heap method?
A. O(v)
B. O(VlogV)
C. O(E)
D. O(ElogV)
Answer: D
43. The running time of Bellmann Ford algorithm is lower than that of Dijkstra’s algorithm.
A. True
B. False
Answer : B
44. Dijkstra’s Algorithm run on a weighted, directed graph G={V,E} with non-negative weight function w
and source s, terminates with d[u]=deltas(s,u) for all vertices u in V.
E. True
F. False
Answer : A

45. Consider the following graph:

If b is the source vertex, what is the minimum cost to reach f vertex?


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

47. Dijkstra’s Algorithm is the prime example of


A. Greedy Algorithm
B. Branch and Bound
C. Back tracking
D. Dynamic programming
Answer : A
48. What are splay trees?
A. Self adjusting binary search trees
B. Self adjusting binary trees
C. A tree with strings
D. A tree with probability distributions
Answer : A
49. Why to prefer splay trees?
A. Easier to program
B. Space efficiency
C. Easier to program and faster access to accessed items
D. Quick searching
Answer: C
50. Whichof the following property of splay tree is correct?
A. It holds probability usage of the respective sub trees
B. Any sequence of j operations starting from an empty tree with h nodes atmost , takes
O(jlogh) time complexity
C. Sequence of operations with h nodes can tale O(logh) time complexity
D. Splay trees are unstable trees
Answer: B
51. Is it true that splay trees have O(logn) amortized complexity?
A. True
B. False
Answer: A
52. What is a splay operation?
A. Moving parent node to down of child
B. Moving a node to root
C. Moving root to leaf
D. Removing leaf node
Answer : B
53. Which of the following options is an application of splay trees?
A. Catche iplementation
B. networks
C. Send values
D. Receive values
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

54. What is the disadvantage of using spaly trees?


A. Height of splay tree can be linera when accessing elements in on decreasing order.
B. Splay operations are difficult
C. No significant disadvantage
D. Spaly tree performs unnecessary splay when a ode is only being read
Answer : A
55. What output does the below pseudo code produces?
Tree_node function(Tree_node x)
{
Tree_node y=x.left;
x.left = y.right;
y.right = x;
return y;
}

A. Right rotation of subtree


B. Left rotation of subtree
C. Zig-zig opertion
D. Zig-zag operation
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

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))
Answer : A
2. Problems that can be solved in polynomial time are known as?
A. Intractable
B. Tractable
C. Decision
D. Complete
Answer : B
3. The sum and composition of two polynomials are always polynomials.
A. True
B. False
Answer : A
4. _________ is the class of decision problems that can be solved by non-deterministic
polynomial algorithms?
A. NP
B. P
C. Hard
D. Complete
Answer : A
5. The Euler’s circuit problem can be solved in?
A. O(N)
B. O( N log N)
C. O(log N)
D. O(N2)
Answer :D
6. To which class does the Euler’s circuit problem belong?
A. P class
B. NP class
C. Partition class
D. Complete class
Answer: A
7. Halting problem is an example for?
A. Decidable problem
B. Undecidable problem
C. Complete problem
D. Trackable problem
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

21. The worst case occur in quick sort when


A. Pivot is the median of the array
B. Pivot is the smallest element
C. Pivot is the middle element
D. None of the mentioned
Answer : B

22. The big-theta notation for function f(n) = 2n3 + n – 1 is


A. n
B. n2
C. n3
D. n4
Answer : C
23. Which of the following algorithm can be used to solve the Hamiltonian path problem
efficiently?
A. Branch and bound
B. Iterative improvement
C. Divide and conquer
D. Greedy algorithm
Answer : A
24. The problem of finding a path in a graph that visits every vertex exactly once is called?
A. Hamiltonian path problem
B. Hamiltonian cycle problem
C. Subset sum problem
D. Turnpike reconstruction problem
Answer : A
25. Hamiltonian path problem is _________
A. NP problem
B. N class problem
C. P class problem
D. NP complete problem
Answer : D
26. Quick sort efficiency can be improved by adopting
A. Non-recursive method
B. Insertion method
C. Tree search method
D. None of the above
Answer : A
27. If f(x) = (x3 – 1) / (3x + 1) then f(x) is
A. O(x2)
B. O(x)
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

29. If n=4, then the value of O(n3) is


A. 4
B. 6
C. 64
D. 512
Answer : C
30. A growth rate of n, is referred to as
A. Absolute growth rate
B. Linear growth rate
C. Exponential growth rate
D. Quadratic growth rate
Answer : B
31. Optimal page replacement algorithm is also called as __________
A. LIFO
B. NRU
C. Clairvoyant replacement algorithm
D. Page buffering
Answer : C
32. Which of the following methods can be used to solve n-queen’s problem?
A. Greedy algorithm
B. Divide and conquer
C. Iterative improvement
D. Backtracking
Answer : D
33. Which algorithm is better for sorting between bubble sort and quicksort?
A. Bubble Sort
B. Quick Sort
C. Both
D. None
Answer : B
34. State true or false: Time complexity of binary search algorithm is 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

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

2. Problems that can be solved in polynomial time are known as?


a) intractable
b) tractable
c) decision
d) complete

Ans : b

3. The sum and composition of two polynomials are always polynomials.


a) true
b) false

Ans : a

4. _________ is the class of decision problems that can be solved by non-deterministic


polynomial algorithms?
a) NP
b) P
c) Hard
d) Complete

Ans : a

5. Problems that cannot be solved by any algorithm are called?


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

a) tractable problems
b) intractable problems
c) undecidable problems
d) decidable problems

Ans : c

6. The Euler’s circuit problem can be solved in?


a) O(N)
b) O( N log N)
c) O(log N)
d) O(N2)

Ans : d

7. To which class does the Euler’s circuit problem belong?


a) P class
b) NP class
c) Partition class
d) Complete class

Ans : a

8. Halting problem is an example for?


a) decidable problem
b) undecidable problem
c) complete problem
d) trackable problem

Ans : b

9. How many stages of procedure does a non-deterministic algorithm consist of?


a) 1
b) 2
c) 3
d) 4

Ans : b

10. A non-deterministic algorithm is said to be non-deterministic polynomial if the time-


efficiency of its verification stage is polynomial.
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

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

12. To which of the following class does a CNF-satisfiability problem belong?


a) NP class
b) P class
c) NP complete
d) NP hard

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

14. Which of the following problems is not NP complete?


a) Hamiltonian circuit
b) Bin packing
c) Partition problem
d) Halting problem

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

16. What does NP stands for in complexity classes theory?


a) Non polynomial
b) Non-deterministic polynomial
c) Both (a) and (b)
d) None of the mentioned

Ans : b

17. The hardest of NP problems can be:


a) NP-complete
b) NP-hard
c) P
d) None of the mentioned

Ans : a

18. What are the examples of polynomial problems?


a) finding factorial
b) matrix multiplication
c) insertion sort
d) all of the above

Ans : d

19. Which of these are non tractable problems?


A) hamiltonian cycle
B) travelling salesman problem
C) tower of hanoi
D) all of the above

Ans : d

20. The nondeterministic algorithm operates in two phases i.e.


a) guessing
b) verification
c) both a and 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

d) none of the above

Ans : c

21. Which of the problems are non deterministic?


a) finding odd or even
b) sorting
c) finding max
d) all of the above

Ans : d

22. P is also known as


a) PTIME
b) DTIME
c) both a and b
d) none of these

Ans : c

23. Examples of P problem are


a) searching n element in array
b) inserting element at the end of linked list
c) sorting data using selection sort
d) all of the above

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

26. Travelling salesman problem belongs to which of the class?


a) P
b) NP
c) Linear
d) None of the mentioned

Ans : b

27. State true or false?


Statement: If a problem X is in NP and a polynomial time algorithm for X could also be used to
solve problem Y in polynomial time, then Y is also in NP.
a) true
b) false

Ans : a

28. 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 of the mentioned

Ans : a

29. Which of the following is incorrect for the given phrase


Phrase : ‘solvable by non deterministic algorithms in polynomial time’
a) NP Problems
b) During control flow, non deterministic algorithm may have more than one choice
c) If the choices that non deterministic algorithm makes are correct, the amount of time it takes is
bounded by polynomial time.
d) None of the mentioned

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

31. Which of the following can be used to define NP complexity class?


a) Verifier
b) Polynomial time
c) Both (a) and (b)
d) None of the mentioned

Ans : c

32. Which of the following are not in NP?


a) All problems in P
b) Boolean Satisfiability problems
c) Integer factorization problem
d) None of the mentioned

Ans : d

1. Which one of the following are NP-complete?


A. Vertex cover problem
B. Hamiltonian Cycle Problem
C. 3SAT problem
D. A and C
Answer :D

2. Problems solved in poynomial time are called?


A. Tractable
B. Intractable
C. decision
D. complete
Answer :A

3. Euler’s circuit belongs to which class?


A. P class
B. NP class
C. Np- complete
D. Np-hard
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

4. Halting problem was the prblm given by


A. Euler
B. Turing
C. Newton
D. Pascal
Answer :B

5. Which of the following is not NP-Complete


A. Hamiltonian circuit
B. Bin-Picking
C. Partition problem
D. Halting Problem
Answer :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

9. Hamiltonian circuit problem is a special case of


A. Halting problem
B. Hitting set
C. Travelling Salesman Problem
D. None
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 , 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

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

11. Which of the following can be solved in polynomial time


A. Linear Programming
B. Greatest common divisor
C. both
D. none
Answer :D

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?

A. P’ is NP-hard but not NP-complete


B. P’ is in NP but its not Np-complete
C. P’ is NP-complete
D. P’ is neither NP-hard, nor in NP
Answer :C

13. A problem in NP is NP-complete if


A. It can be reduced to 3sat problem in polynomial time
B. The 3sat problem can be reduced to it in polynomial time
C. It can be reduced to any other problem in NP in polynomial time
D. Some problem in NP can be reduced to it in polynomial time
Answer :B

14. The problems 3SAT and 2SAT are


A. Both in P
B. Both NP-complete
C. NP-complete and P respectively
D. Undecidable and Np-Complete respectively
Answer : C

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

16. Which of the following is true?


1) The problem of determinig whether there exist a cycle in an undirected graph is in P.
2) The problem of determining whether there exist a cycle in an undirected graph is in NP.
3) If a problem A is NP-complete there exists a non-deterministic polynomial time alogorithm
to solve A
A. 1,2,3
B. 2,3
C. none
D. all of the given
Answer : A

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

18. 3 SAT problem must contain how many literals?


A. 1
B. 2
C. 3
D. Any number of literals
Answer : C

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

20. A decision problem L is NP-complete if:


1) L is in NP (Any given solution for NP-complete problems can be verified quickly, but there is
no efficient known solution).
2) Every problem in NP is reducible to L in polynomial tim
A. Only 1
B. Only 2
C. Both 1 and 2
D. NOne
Answer : C

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

22. Running time of vertex cover problem is


A. O(V)
B. O(E)
C. O(V+E)
D. O(V*E)
Answer :C

23. What is true about the P class problems


A. Solved in polynomial time
B. Finding a way from point A to point B comes under P class problems
C. Travelling Salesman is a P class problem
D. Both A and B
Answer :D
24. Which of the following statement is false?
A. Halting problem is undecidable
B. It was given by Alan Turing
C. The Turing Machine in the problem may or may not halt
D. None of the above
Answer :D

25.Match the following


Group A Group B
a) Dijkstra’s single shortest path p) Dynamic Programming
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) Bellmen Ford’s single shortest path algorithm q) Backtracking


c) Floyd Warshell’s all pair shortest path algorithm r) Greedy Algorithm
Select one

A. a-p, b-p, c-p


B. a-p, b-r, c-q
C. a-r, b-q, c-p
D. a-r, b-p, c-p
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 , 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

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

c) graph coloring 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

14. Evolutionary computation is a sub-field of ___.


a. Evolutionary strategies
b. Evolutionary Algorithm
c. Genetic algorithms
d. artificial intelligence
Answer: d
15. An Evolutionary Algorithm is generic, population-based optimization algorithm that
generates solution via biological operators.
a. True
b. False
c. inadequate information
d. None of these
Answer: a

16. What is the applications of Genetic algorithms ___.


a. Mutation testing
b. Code breaking
c. Recurrent Neural Network
d. all of the above
Answer: d
17. An EA contains four overall steps: initialization, selection, genetic operators, and termination.
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. 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

a. heuristic search algorithms , Evolutionary algorithms.


b. natural selection, genetics
c. members, genetic operators
d. None of these
Answer: b
22. Recombination is an operator to two or ______ selected candidates which results in new
candidates.
a. one
b. two
c. more
d. zero
Answer: c
23. GAs are a subset of a much larger branch of computation known as ___.
a. Evolutionary strategies
b. Evolutionary Computation
c. Evolutionary algorithms.
d. none
Answer: b
24. Mutation is applied to ne candidate resulting in ____ new candidate.
a. two
b. more
c. one
d. none
Answer: c
25. Genetic Algorithms (GAs) are adaptive ____ that belong to the larger part of evolutionary
algorithms.
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. heuristic search algorithms


b. Evolutionary algorithms.
c. Evolutionary strategies
d. none
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 , 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

1. Functional Model is also known as ___


A. Object Oriented Model
B. Structured Programming Model
C. Declarative Model
D. Imperative Model
Answer : C
2. For a model to be good computational model ,it should have features such as
A. Method of Combination
B. Primitive expression
C. Method of abstraction
D. All the above
Answer : D
3. The model which establishes relationship between the entities taking part in computation in form of
function, is ___
A. Descriptive model
B. Declarative model
C. Imperative model
D. Object Oriented model
Answer :B
4. What is tail recursion?
A. A recursive function that has two base cases
B. A function where the recursive functions leads to an infinite loop
C. A recursive function where the function doesn’t return anything and just prints the values
D. A function where the recursive call is the last thing executed by the function
Answer : D
5. The Step of recursion, which reduces the problem to base case
A. End step
B. Inductive step
C. Recursive step
D. Base step
Answer :B
6. Recursive computation has ___ phases
A. Growing and Shrinking
B. Growing and Termination
C. Starting and Shrinking
D. Starting and Termination
Answer : A
7. In growing phase , the function call is replaced by ______
A. Another function call
B. Definition of function
C. Recursive call
D. Return value
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: 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

23. Order of execution is important in which model?


A.Descriptive model
B.Declarative model
C.Imperative model
D .Object Oriented model
Answer :C

24. Which of the following is an example of functional model?


A. C,C++,Java
B. SQL,HTML
C. Both A and B
D. None of the above
Answer :B
25. Which of the following is an example of imperative model?
A. C,C++,Java

B. SQL,HTML
C. Both A and B
D. None of the above
Answer :A

26. Prototyping allow us to


A. Translation of mathematical specification to executable form
B. Interative model for coding ,testing and verification
C. Detailed analysis of correctness and efficiency of algorithm
D. All of the above
Answer : D

1. In logical statement P=>Q, P is called as


A. Conclusion
B. Post condition
C. Assumption or Precondition
D. None of these
Answer : C
2. {I} Q {O}, where I and Q are input and output assertions. It means
A. If I holds before the execution of Q, then O holds after completion of Q.
B. If I holds after the execution of Q, then O holds before completion of Q.
C. I and O holds after the completion of Q.
D. None of these
Answer : A
3. {P} S {R}, R => Q / {P] S {Q} can be expressed as
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

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

8. Algorithm for Exit Loop construct with assertions inserted is given as

[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

B. Used for user defined iteration


C. Same as switch case statement
D. None of above
Answer :
22. Selection logic is also called as
A. Iteration logic
B. Decision logic
C. Selection logic
D. Sequence logic
Answer : C
23. Which of the following is not principle of structured programming
A. Design the program in top down manner
B. Code the program so that it runs correctly without testing
C. Write each program module as a series of control structure
D. Use good programming
Answer : A
24. Which of the following is not basic control structure
A. The Process
B. The loop
C. The decision
D. The sequential
Answer : A
25. One of the advantages that cannot be gain by function subprograms is
A. Simplicity
B. Modular approach
C. Code Reduction
D. Reuse
Answer : C
DAA Unit- 1 MCQs

1.Which of the following is incorrect?


Algorithms can be represented:
a) as pseudo codes
b) as syntax
c) as programs
d) as flowcharts

Ans- b

2. When an algorithm is written in the form of a programming language, it becomes a _________


a) Flowchart
b) Program
c) Pseudo code
d) Syntax

Ans-b

3. which algorithm needs the minimum number of swap


a. Bubble sort

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

5.Different waysn to represent the solution

a. Natural language

b.pseudo code

c.flowcart

d.all of the above


ans- d

6. This representation completely omits technical aspects of programming language syntax

a. Natural language

b. pseudo code

c. Flowchart

d. None of the above

ans - a

7. It is graphical representation of the algorithm

a. Natural language

b. pseudo code

c. Flowchart

d. None of the above

ans- c

8. This representation is very near to the generalized programming language syntax

a. Natural language

b. pseudo code

c. Flowchart

d. None of the above

ans-b

9. Algorithm should also be considered as technology likehardware

a. True

b. False

ans- a

10. Time complexity of quick sort algorithm


a. nlogn

b. logn

c. n^2

d. none of the above

ans- a

11. Space complexity of quick sort algorithm (worst case)

a. nlogn

b. logn

c. n^2

d. none of the above

ans-b

12. Study of tractable and non-tractable problems is called as ________

a. divide and conquer

b. Complexity theories

c. computational theory

d. none of the above

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

d. None of the above

ans- c

14. Tractable problems can be solved in reasonable time


a. true

b. false

ans- a

15. Approximation algorithm provides approximate solutions for

a. tractable problems

b. non- tractable problem

ans- b

16. Statement –“Any program is an algorithm but the reverse is not true.”

a. true

b. false

ans - a

17.Algorithms could be used in

a. determining the route

b. interpolating addresses

c. rendering the graphics

d. all of the above

ans – d

18. _____ uses standard setoff symbols to represent the flow of operations.

a. Natural language

b. pseudo code

c. Flowchart

d. None of the above

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.

a. divide and conquer

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

23. Problems for which algorithm is not found :

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

A. Counting the maximum memory needed by the algorithm

B. Counting the minimum memory needed by the algorithm

C. Counting the average memory needed by the algorithm

D. Counting the maximum disk space needed by the algorithm


Ans- a

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

You might also like