Data Structures Algorithms-II MCQs

Page No. 103

What is the space complexity of the divide and conquer algorithm used to find the maximum sub-array sum?


aO(n)


bO(1)


cO(n!)


dO(n2)


View Answer O(n2)

What is the time complexity of the divide and conquer algorithm used to find the maximum sub-array sum?


aO(n)


bO(logn)


cO(nlogn)


dO(n2)


View Answer O(nlogn)

Find the maximum sub-array sum for the given elements. {-2, -1, -3, -4, -1, -2, -1, -5, -4}


a-3


b5


c3


d-1


View Answer -1

Find the maximum sub-array sum for the given elements. {2, -1, 3, -4, 1, -2, -1, 5, -4}


a3


b5


c8


d6


View Answer 5

Given a one-dimensional array of integers, you have to find a sub-array with maximum sum. This is the maximum sub-array sum problem. Which of these methods can be used to solve the problem?


aDynamic programming


bTwo for loops (naive method)


cDivide and conquer


dDynamic programming, naïve method and Divide and conquer methods



Find the maximum sub-array sum for the following array:{3, 6, 7, 9, 3, 8}


a33


b36


c23


d26


View Answer 36

What is the space complexity of Kadane’s algorithm?


aO(1)


bO(n)


cO(n2)


dNone of the mentioned


View Answer O(1)

What is the time complexity of Kadane’s algorithm?


aO(1)


bO(n)


cO(n2)


dO(5)


View Answer O(n)

For which of the following inputs would Kadane’s algorithm produce a WRONG output?


a{1,0,-1}


b {-1,-2,-3}


c {-1,-2,-3}


d{0,0,0}


View Answer {-1,-2,-3}

For which of the following inputs would Kadane’s algorithm produce the INCORRECT output?


a{0,1,2,3}


b{-1,0,1}


c{-1,-2,-3,0}


d{-4,-3,-2,-1}


View Answer {-4,-3,-2,-1}

Goto Page No.

Page 103 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