Data Structures Algorithms-II MCQs

Page No. 93

What will be the recurrence relation of the following code?


aT(n) = T(n/2) + n


bT(n) = T(n-1) + n


cT(n) = T(n-1) + O(1)


d T(n) = T(n/2) + O(1)


View Answer T(n) = T(n-1) + O(1)

Solve the following recurrence using Master’s theorem. T(n) = 16T (n/4) + n


aT(n) = O(n)


bT(n) = O(log n)


cT(n) = O(n2log n)


dT(n) = O(n2)


View Answer T(n) = O(n2)

Solve the following recurrence using Master’s theorem. T(n) = T (n/2) + 2n


aT(n) = O(n2)


bT(n) = O(n2 log n)


cT(n) = O(2n)


dcannot be solved


View Answer T(n) = O(2n)

Solve the following recurrence using Master’s theorem. T(n) = 4T (n/2) + n2


aT(n) = O(n)


bT(n) = O(log n)


cT(n) = O(n2log n)


d T(n) = O(n2)


View Answer T(n) = O(n2log n)

Given items as {value,weight} pairs {{60,20},{50,25},{20,5}}. The capacity of knapsack=40. Find the maximum value output assuming items to be divisible and nondivisible respectively.


a100, 80


b 110, 70


c130, 110


d110, 80


View Answer 110, 80

The main time taking step in fractional knapsack problem is ___________


a Breaking items into fraction


b Adding items into knapsack


cSorting


dLooping through sorted items


View Answer Sorting

The result of the fractional knapsack is greater than or equal to 0/1 knapsack.


aTrue


b False


cA & B


dNone of these


View Answer True

Given items as {value,weight} pairs {{40,20},{30,10},{20,5}}. The capacity of knapsack=20. Find the maximum value output assuming items to be divisible.


a 60


b 80


c 100


d40


View Answer 60

Fractional knapsack problem can be solved in time O(n).


aTrue


b False


cA & B


dNone of these


View Answer True

Time complexity of fractional knapsack problem is ____________


a O(n log n)


bO(n)


c O(n2)


dO(nW)


View Answer O(n log n)

Goto Page No.

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