Data Structures Algorithms-II MCQs

Page No. 94

Which of the following statement about 0/1 knapsack and fractional knapsack problem is correct?


a In 0/1 knapsack problem items are divisible and in fractional knapsack items are indivisible

✖


b Both are the same

✖


c0/1 knapsack is solved using a greedy algorithm and fractional knapsack is solved using dynamic programming

✖


d In 0/1 knapsack problem items are indivisible and in fractional knapsack items are divisible

✓



What is the objective of the knapsack problem?


a To get maximum total value in the knapsack

✓


bTo get minimum total value in the knapsack

✖


cTo get maximum weight in the knapsack

✖


dTo get minimum weight in the knapsack

✖



Fractional knapsack problem is solved most efficiently by which of the following algorithm?


aDivide and conquer

✖


b Dynamic programming

✖


cGreedy algorithm

✓


dBacktracking

✖


View Answer Greedy algorithm

Fractional knapsack problem is also known as __________


a0/1 knapsack problem

✖


bContinuous knapsack problem

✓


cDivisible knapsack problem

✖


dNon continuous knapsack problem

✖



What is the running time of the Huffman algorithm, if its implementation of the priority queue is done using linked lists?


aO(C)

✖


bO(log C)

✖


cO(C log C)

✖


dO(C2)

✓


View Answer O(C2)

What is the running time of the Huffman encoding algorithm?


aO(C)

✖


bO(log C)

✖


cO(C log C)

✓


dO( N log C)

✖


View Answer O(C log C)

The type of encoding where no character code is the prefix of another character code is called?


aoptimal encoding

✖


b prefix encoding

✓


cfrequency encoding

✖


dtrie encoding

✖


View Answer prefix encoding

An optimal code will always be present in a full tree.


atrue

✓


b false

✖


cA & B

✖


dNone of these

✖


View Answer true

What will be the cost of the code if character ci is at depth di and occurs at frequency fi?


a cifi

✖


b ∫cifi

✖


c∑fidi

✓


d fidi

✖


View Answer ∑fidi

From the following given tree, what is the computed codeword for ‘c’?


a111

✖


b101

✖


c110

✓


d011

✖


View Answer 110

Goto Page No.

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