The assignment is submitted after the due date. The submitted assignment is other than an MS Word file. The submitted assignment does NOT open or the file is corrupted. The assignment is copied from other students or ditto copy from handouts or the internet. The objectives of this assignment are to make you familiar with Knapsack using Greedy Approach. To make you familiar with Huffman encoding and tree.

**CS502 Assignment 3 Solution Fall 2022, CS502 assignment 3 solution, cs502 assignment 2 solution 2022, cs502 assignment solution 2022, cs401 assignment 4 solution 2022, cs502 assignment 3 solution fall 2022**

**Question No 1**

A thief enters in a Gold shop carrying a 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.

**Question No 2**

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

#### Watch Solution Video Click Here

You are required to do the following task:

- Calculate frequency of characters.
- Generate Huffman Tree
- Write the code of every character
- Required total no of bits

**CS502 Assignment 3 Solution Fall 2022, CS502 assignment 3 solution, cs502 assignment 2 solution 2022, cs502 assignment solution 2022, cs401 assignment 4 solution 2022, cs502 assignment 3 solution fall 2022**