Data Structures Algorithms-II MCQs

Page No. 112

Given a string, you have to find the minimum number of characters to be inserted in the string so that the string becomes a palindrome. Which of the following methods can be used to solve the problem?


aGreedy algorithm

✖


bRecursion

✖


cDynamic programming

✖


dBoth recursion and dynamic programming

✓



What is the space complexity of the following dynamic programming implementation of the maximum sum rectangle problem?


aO(row*col)

✖


bO(row)

✓


cO(col)

✖


dO(row*col*col)

✖


View Answer O(row)

What is the time complexity of the following dynamic programming implementation of the maximum sum rectangle problem?


aO(row*col)

✖


bO(row)

✖


c O(col)

✖


dO(row*col*col)

✓


View Answer O(row*col*col)

Which of the following lines should be inserted to complete the above code?


a val = mx_sm

✖


breturn val

✖


cmx_sm = val

✓


dreturn mx_sm

✖


View Answer mx_sm = val

The dynamic programming implementation of the maximum sum rectangle problem uses which of the following algorithm?


aHirschberg’s algorithm

✖


bNeedleman-Wunsch algorithm

✖


cKadane’s algorithm

✓


dWagner Fischer algorithm

✖


View Answer Kadane’s algorithm

What is the time complexity of the brute force implementation of the maximum sum rectangle problem?


aO(n)

✓


bO(n2)

✖


cO(n3)

✖


d O(n4)

✖


View Answer O(n4)

Consider the 3×3 matrix {{2,1,-3},{6,3,4},{-2,3,0}}. What is the sum of the elements of the maximum sum rectangle?


a13

✖


b16

✖


c14

✓


d19

✖


View Answer 14

Consider the 2×2 matrix {{-1,-2},{-3,-4}}. What is the sum of elements of the maximum sum rectangle?


a0

✖


b-1

✓


c -7

✖


d-12

✖


View Answer -1

Consider the 2×3 matrix {{1,2,3},{1,2,3}}. What is the sum of elements of the maximum sum rectangle?


a3

✖


b6

✖


c12

✓


d8

✖


View Answer 12

Consider a matrix in which all the elements are non-zero(at least one positive and at least one negative element). In this case, the sum of the elements of the maximum sum rectangle cannot be zero.


ature

✓


bFalse

✖


cA & B

✖


d None of these

✖


View Answer ture

Goto Page No.

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