Data Structures Algorithms-II MCQs

Page No. 149

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?


aO(n)


bO(q)


cO(n*q)


dO(n+q)


View Answer O(n*q)

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


a true


bfalse


cA & B


dAll of the above


View Answer False

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


aO(√n)


bO(n)


c O(1)


dO(n2)


View Answer O(1)

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


b2*√n


c3*√n


dn*√n


View Answer 3*√n

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?


aO(n)


bO(l+r)


cO(√n)


dO(r-l)


View Answer O(√n)

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?


aO(n)


bO(l+r)


cO(l-r)


dO(r-l)


View Answer O(n)

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


an


b√n


cn2


dn-1/2


View Answer √n

What is the purpose of using square root decomposition?


ato reduce the time complexity of a code


bto increase the space complexity of a code


cto reduce the space complexity of a code


dto reduce the space and time complexity of a code



Goto Page No.

Page 149 of 149

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan