VU Answer Gives Perfect CS502 Assignment 3 Solution Fall 2021 PDF. It's a Complete Step by Step CS502 Assignment 3 Solution 2022 and Easy to Download PDF, CPP, and Word Solution File Below.

CS502 ASSIGNMENT 3 SOLUTION FALL 2021

Provide by VU Answer

Total Marks: 20

Due Date: 10 Feb 2022

Question 1:

A thief enters in a Gold shop carrying knapsack (bag). Knapsack (bag) capacity is 33KG of weight. The shop has only 10 gold bricks; each brick has a specific weight and price. Now, the thief’s dilemma is to make such a selection of bricks that it maximizes the profit (i.e. total price) without exceeding the knapsack (bag) weight.

You are required to do the following task:

1. Help the thief for the selection of bricks using greedy method for getting maximum profit.

Solution:

Weight(KG):

1+5+3+2+4+6+7+(11-6)

1+5+3+2+4+6+7+5

## 33KG

**
**

Price:

$50 + $200+ $110+ $70+ $120+ $153+ $140+ (160/11*5)

$50 + $200+ $110+ $70+ $120+ $153+ $140+ $72.72

## $915.72

Maximum Profit = $915.72

2. Which approach will be used for this scenario (write only name)?

Solution:

Greedy Method About Price/Weight Ratio

Question 2:

A well-known Network Solution company that deals with large volumes of data over the network wants to use a data compression technique that reduces the coding redundancy without loss of data quality. For trial/test execution the company has decided to use Huffman encoding algorithm to encode the given string "allamaiiii” before transmitting over the network.

You are required to do the following task:

Calculate the frequency of characters.

Generate Huffman Tree

Write the code of every character

Required total no of bits

Solution:

Giving String “allamaiiii”

2. Generate Huffman Tree

Solution:

3. Write the code of every character

Solution:

4. Required total no of bits

Solution:

Required Total No of Bits = 19

**
**

PLEASE NOTE:

Make sure you can make some changes to your solution file before submitting copy-paste solution will be marked zero.

If you found any mistake then correct yourself and inform me.

Before submitting an assignment check your assignment requirement file.

If you need some help and question about file and solutions.

**CS502 Assignment 3 Solution 2022**

**CS502 Assignment No 3 Solution Fall 2021**

**CS502 Assignment 3 Solution Fall 2022**

**CS502 Assignment Solution 2022**

## 0 Comments