Explore topic-wise MCQs in Square Root Decomposition Multiple Choice.

This section includes 11 Mcqs, each offering curated multiple-choice questions to sharpen your Square Root Decomposition Multiple Choice knowledge and support exam preparation. Choose a topic below to get started.

1.

What will be the time complexity of the code to find a minimum element from an array of size n and uses square root decomposition(exclude pre processing time)?

A. O( n)
B. O(n)
C. O(1)
D. O(n<sup>2</sup>)
Answer» B. O(n)
2.

Mo s algorithm can only be used for problems where the query can be calculated from the result of the previous query.

A. true
B. false
Answer» B. false
3.

What will be the worst case time complexity of code to find sum in given query range (l,r) in an array of size n with q number of such queries when we apply MO s algorithm?

A. O(n*q)
B. O(n)
C. O((q+n) n)
D. O(q* n)
Answer» D. O(q* n)
4.

What will be the worst case time complexity of code to find sum in given query range (l,r) in an array of size n with q number of such queries?

A. O(n)
B. O(q)
C. O(n*q)
D. O(n+q)
Answer» D. O(n+q)
5.

Square root decomposition technique is only applicable when the number of indices in an array is a perfect square.

A. true
B. false
Answer» C.
6.

What will be the time complexity of update query operation in an array of size n when we use square root optimization?

A. O( n)
B. O(n)
C. O(1)
D. O(n<sup>2</sup>)
Answer» D. O(n<sup>2</sup>)
7.

Total how many iterations are required to find the sum of elements in a given range of (l,r) in an array of size n when we use square root optimization?

A. n
B. 2* n
C. 3* n
D. n* n
Answer» D. n* n
8.

What will be the worst case time complexity of finding the sum of elements in a given range of (l,r) in an array of size n when we use square root optimization?

A. O(n)
B. O(l+r)
C. O( n)
D. O(r-l)
Answer» D. O(r-l)
9.

What will be the worst case time complexity of finding the sum of elements in a given range of (l,r) in an array of size n?

A. O(n)
B. O(l+r)
C. O(l-r)
D. O(r-l)
Answer» B. O(l+r)
10.

By what factor time complexity is reduced when we apply square root decomposition to a code?

A. n
B. n
C. n<sup>2</sup>
D. n<sup>-1/2</sup>
Answer» C. n<sup>2</sup>
11.

What is the purpose of using square root decomposition?

A. to reduce the time complexity of a code
B. to increase the space complexity of a code
C. to reduce the space complexity of a code
D. to reduce the space and time complexity of a code
Answer» B. to increase the space complexity of a code