Data Structures Algorithms-II MCQs

Page No. 113

Consider the following statements and select which of the following statement are true. Statement 1: The maximum sum rectangle can be 1X1 matrix containing the largest element If the matrix size is 1X1 Statement 2: The maximum sum rectangle can be 1X1 matrix containing the largest element If all the elements are zero Statement 3: The maximum sum rectangle can be 1X1 matrix containing the largest element If all the elements are negative


a Only statement 1 is correct


bOnly statement 1 and Statement 2 are correct


cOnly statement 1 and Statement 3 are correct


dStatement 1, Statement 2 and Statement 3 are correct



In which of the following cases, the maximum sum rectangle is the 2D matrix itself?


aWhen all the elements are negative


bWhen all the elements are positive


cWhen some elements are positive and some negative


dWhen diagonal elements are positive and rest are negative



Given a 2D matrix, find a submatrix that has the maximum sum. Which of the following methods can be used to solve this problem?


aBrute force


bRecursion


cDynamic programming


dBrute force, Recursion, Dynamic programming



What is the sum of each of the balanced partitions for the array {5, 6, 7, 10, 3, 1}?


a16


b32


c0


d64


View Answer 16

Consider a variation of the balanced partition problem in which we find two subsets such that |S1 – S2| is minimum. Consider the array {1, 2, 3, 4, 5}. Which of the following pairs of subsets is an optimal solution for the above problem?


a {5, 4} & {3, 2, 1}


b{5} & {4, 3, 2, 1}


c{4, 2} & {5, 3, 1}


d{5, 3} & {4, 2, 1}


View Answer {5, 3} & {4, 2, 1}

What is the time complexity of the brute force algorithm used to solve the balanced partition problem?


aO(1)


bO(n)


cO(n2)


dO(2n)


View Answer O(2n)

In which of the following cases, it is not possible to have two subsets with equal sum?


aWhen the number of elements is odd


bWhen the number of elements is even


cWhen the sum of elements is odd


dWhen the sum of elements is even



Given an array, check if the array can be divided into two subsets such that the sum of elements of the two subsets is equal. This is the balanced partition problem. Which of the following methods can be used to solve the balanced partition problem?


aDynamic programming


bRecursion


cBrute force


dDynamic programming, Recursion, Brute force



There are 10 dice having 5 faces. The faces are numbered from 1 to 5. What is the number of ways in which a sum of 4 can be achieved?


a0


b2


c4


d8


View Answer 0

There are n dice with f faces. The faces are numbered from 1 to f. What is the maximum possible sum that can be obtained when the n dice are rolled together?


a1


bf*f


cn*n


dn*f


View Answer n*f

Goto Page No.

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