Question # 1: 10Marks (5+5)
In the context of Activity Selection Problem, consider the following set of activities:
You are required to find the optimal solution (usingGreedy Algorithm) for the following two greediness approaches:
Select the activities that start first and schedule them(5 marks)
- Select the activities that finish first and schedule them(5 marks)
No need to provide any pseudo/working code. Just provide the results for each greediness approach of the following two steps in the below mentioned tabular form:
- Sorted Activities
- Final Selected Activities
Question # 2: 10 Marks
Consider the following scenario in which a set of Alphabets along with their frequencies is given. You are required to generate the output binary tree and find the Variable-length codes for the given Alphabets using the provided Huffman Coding Algorithm.
Total File Length: 210
Huffman Coding Algorithm:
- Consider all pairs: <frequency, symbol>.
- Choose the two lowest frequencies, and make them brothers, with the root having the combined frequency.
No need to provide all the steps of the binary tree generation. Only mention the Final Binary Tree and the Variable-length codes for the given Alphabets in tabular form.
Your solution should be strictly according to the below-mentioned template.
Alphabets: A, B, C, D, E, F
Total File Length: 100
|Letter to be encoded||A||B||C||D||E||F|
DOWNLOAD SOLUTION HERE