Data Structures Algorithms-II MCQs

Page No. 106

Which of the following methods can be used to solve the Knapsack problem?


aBrute force algorithm


bRecursion


cDynamic programming


dBrute force, Recursion and Dynamic Programming



The Knapsack problem is an example of ____________


aGreedy algorithm


b 2D dynamic programming


c1D dynamic programming


dDivide and conquer



Consider the brute force implementation in which we find all the possible ways of multiplying the given set of n matrices. What is the time complexity of this implementation?


aO(n!)


bO(n3)


cO(n2)


dExponential


View Answer Exponential

Consider the matrices P, Q, R and S which are 20 x 15, 15 x 30, 30 x 5 and 5 x 40 matrices respectively. What is the minimum number of multiplications required to multiply the four matrices?


a6050


b7500


c7750


d12000


View Answer 7750

Consider the matrices P, Q and R which are 10 x 20, 20 x 30 and 30 x 40 matrices respectively. What is the minimum number of multiplications required to multiply the three matrices?


a18000


b12000


c24000


d32000


View Answer 18000

Consider the two matrices P and Q which are 10 x 20 and 20 x 30 matrices respectively. What is the number of multiplications required to multiply the two matrices?


a10*20


b20*30


c10*30


d10*20*30


View Answer 10*20*30

Which of the following is the recurrence relation for the matrix chain multiplication problem where mat[i-1] * mat[i] gives the dimension of the ith matrix?


adp[i,j] = 1 if i=j dp[i,j] = min{dp[i,k] + dp[k+1,j]}


bdp[i,j] = 0 if i=j dp[i,j] = min{dp[i,k] + dp[k+1,j]}


cdp[i,j] = 1 if i=j dp[i,j] = min{dp[i,k] + dp[k+1,j]} + mat[i-1]*mat[k]*mat[j].


ddp[i,j] = 0 if i=j dp[i,j] = min{dp[i,k] + dp[k+1,j]} + mat[i-1]*mat[k]*mat[j].



Which of the following methods can be used to solve the matrix chain multiplication problem?


aDynamic programming


bBrute force


cRecursion


dDynamic Programming, Brute force, Recursion



Which of the following is the longest common subsequence between the strings “hbcfgmnapq” and “cbhgrsfnmq” ?


ahgmq


bcfnq


cbfmq


dfgmna


View Answer fgmna

What is the time complexity of the brute force algorithm used to find the longest common subsequence?


aO(n)


bO(n2)


cO(n3)


dO(2n)


View Answer O(2n)

Goto Page No.

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