0% found this document useful (0 votes)
11 views1 page

Algorithm MCQ Ans

Uploaded by

ripsarker.3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Algorithm MCQ Ans

Uploaded by

ripsarker.3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab MCQ

[email protected] Switch account

* Indicates required question

Email *

Record [email protected] as the email


to be included with my response

You have 4 items with values and *


weights: (Value, Weight) = (40, 20), (50,
10), (100, 40), and (60, 30). If the
knapsack capacity is 50 units and the
items are sorted in decreasing order of
their value-to-weight ratio incorrectly,
what is the maximum value you can
obtain?

A) 140

B) 120

C) 120

D) 100

E) None of them

Name *

Your answer

Section *

4B

3C

Student ID *

Your answer

A real-time system uses Huffman *


encoding to compress characters
arriving in a data stream. If a large
number of high-frequency characters
arrive at once, what is the effect on the
encoding process?

A) Compression eCciency increases

B) Compression eCciency decreases

C) Compression stops

D) The system switches to another


algorithm

You are a logistics manager. You need to *


transport fragile items with varying
values and weights: (Value, Weight) =
(100, 20), (150, 50), (200, 40). Your truck
can carry up to 70 units of weight. What
is the maximum value you can
transport?

A) 275

B) 250

C) 300

D) 315

Two paragraphs of text are compared. *


The first paragraph has 20 words and
the second has 15. If their longest
common subsequence is 10 words, how
many words differ between the two?

A) 10

B) 5

C) 15

D) 20

Your GitHub Profile Link *

Your answer

You are hiking and your backpack can *


carry 15 units of weight. The items you
have are:
Water: Value = 60, Weight = 6
Food: Value = 80, Weight = 7
Clothes: Value = 50, Weight = 5
What should you carry to maximize the
value you take with you?

A) Water and Food

B) Food and Clothes

C) Water and Clothes

D) Water, Food, and Clothes

What happens if two characters in a set *


of data have exactly the same frequency
when constructing a Huffman Tree?

A) The tree becomes unbalanced

B) The code lengths are equal

C) The characters will share the same


code

D) The order of encoding changes

You are writing an automated email *


signature generator. Two people, John
and Jonathan, have signatures "JOHN"
and "JONATHAN". What is the length of
the longest common subsequence of
these names?

A) 3

B) 4

C) 5

D) 6

E)None of them

You are shipping items with a budget of *


$500. The following items have costs
and profits:
Item 1: Cost = $100, Profit = $80
Item 2: Cost = $200, Profit = $150
Item 3: Cost = $150, Profit = $120
Item 4: Cost = $50, Profit = $40
What combination of items maximizes
your profit?

A) Item 1 and Item 2

B) Item 2 and Item 3

C) Item 1 and Item 3

D) Item 1, Item 3, and Item 4

The characters and their frequencies in a *


text are: A: 15, B: 9, C: 12, D: 6, E: 7. If a
higher frequency character is mistakenly
used in place of a lower frequency one,
what would be the difference in the final
compressed bit length compared to the
correct Huffman encoding?

A) +2 bits

B) -1 bit

C) +1 bit

D) 0 bits (no change)

Two programmers have written similar *


but slightly different functions:
Function A: int add(int a, int b) { return a
+ b; }
Function B: int add(int a, int b) { return a -
b; }
What is the longest common
subsequence of the two functions?

A) 8

B) 10

C) 12

D) 14

Two DNA sequences are represented as *


"ACTG" and "GATTACA". What is the
longest common subsequence of these
two sequences?

A) 2

B) 3

C) 4

D) 5

As a jeweler, you have 4 types of *


precious stones with the following
values and weights:
(Value, Weight) = (500, 10), (300, 15),
(200, 5), and (400, 20). Your display case
can hold 25 units of weight. What is the
maximum value of items that can be
displayed?

A) 700

B) 800

C) 900

D) 1000

You have a budget of $500 to purchase *


office supplies. The following items are
available:
Printer: Cost = $300, Value = $200
Laptop: Cost = $400, Value = $300
Chair: Cost = $150, Value = $100
Desk: Cost = $100, Value = $70
Which combination of items maximizes
the value within your budget?

A) Printer and Chair

B) Laptop and Desk

C) Chair and Desk

D) Printer, Chair, and Desk

You are planning to buy properties. Each *


property has a price (Weight) and
potential return (Value). Given the
following:
Property 1: Price = $200,000, Return =
$100,000Property 2: Price = $150,000,
Return = $120,000Property 3: Price =
$100,000, Return = $60,000

You have a budget of $350,000. Which


properties should you invest in to
maximize the return?

A) Property 1 and Property 1

B) Property 1 and Property 3

C) Property 2 and Property 3

D) Property 3 only

When applying Huffman coding to *


compress a multimedia file, the size of
the compressed file increases instead of
decreasing. What could be the reason?

A) The Vle contains many high-


frequency characters

B) The Vle contains many low-frequency


characters

C) The Vle contains characters with


equal frequency

D) The Vle is already compressed

You are allocating bonuses to your *


employees. You have $2000, and each
employee has a bonus demand and
value to the company:
Employee 1: Demand = $800, Value =
$500
Employee 2: Demand = $1000, Value =
$800
Employee 3: Demand = $600, Value =
$400
Which combination of bonuses
maximizes the total value to the
company?

A) Employee 1 and Employee 3

B) Employee 2 only

C) Employee 1 only

D) Employee 2 and Employee 3

You compare two speeches that share *


a common theme. The first speech
contains 1000 words, and the second
has 850. If the longest common
subsequence is 750 words, how many
words are different between the two
speeches?

A) 100

B) 150

C) 250

D) 300

You have an investment budget of *


$1,000,000. You have 4 projects, each
with the following cost and return:
Project 1: Cost = $300,000, Return =
$150,000Project 2: Cost = $500,000,
Return = $300,000Project 3: Cost =
$400,000, Return = $250,000Project 4:
Cost = $200,000, Return = $100,000

You want to maximize your return. Which


projects should you invest in?

A) Projects 1 and 2

B) Projects 2 and 4

C) Projects 3 and 4

D) Projects 1, 3, and 4

If a set of characters has very close *


frequencies, how will the resulting
Huffman Tree differ from one where the
frequencies are more spread out?

A) The tree will have a balanced height

B) The code lengths will be more


variable

C) The compression ratio will be higher

D) The tree will be unbalanced

You are filling a storage unit with items *


of varying values and sizes. Given:
Item 1: Value = 100, Weight = 50
Item 2: Value = 150, Weight = 30
Item 3: Value = 200, Weight = 40
If your storage capacity is 70 units, what
is the maximum value you can store?

A) 250

B) 275

C) 300

D) 320

Page 1 of 1

Submit Clear form

Never submit passwords through Google Forms.

This content is neither created nor endorsed by Google.


Report Abuse - Terms of Service - Privacy Policy

Forms
:

You might also like