Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include using namespace std; int main() { string id; //this string will store the last four characters of the id. cin>>id; //taking input the id

image text in transcribed

#include  using namespace std; int main() { string id; //this string will store the last four characters of the id. cin>>id; //taking input the id string answer="MYIDIS"; //this string will store the answer. for(int i=0;i 

here the code of Question 1 I NEED THE SOLUTION OF QUEASTION 2

Last digit 1243

3 1. Write a function that generates a string considering the last 4 - digits of your STUDENT ID. For example, if your ID is 134436, considering the last 4 - digits the program will generate the string "MYIDISFOURFOURTHREESIX". 2. Write a function that uses Huffman Coding to generate the Prefix Codes of the letters in the string 15 (ignore spaces) generated in Question-1. The functions in Question-1 and 2 will be in a single program and sequence of execution should look something like Figure 1. M: Step 11. Enter Student ID: 1344 Step 12. Generated String: MYIDISFOURFOURTHREESIX Step 3. Prefix Codes (Generated Using Huffman Coding): 1101 1100 011 1011 S: 0011 0010 0001 0000 010 1010 1001 E: 111 x: 1000 R: Figure 1: Generating Prefix Codes Using Huffman Coding. 3. Illustrate in a typed report, the sequence of generating Prefix Codes using Huffman Coding for the same string just to verify the output of your program in Question-2. 7 3 1. Write a function that generates a string considering the last 4 - digits of your STUDENT ID. For example, if your ID is 134436, considering the last 4 - digits the program will generate the string "MYIDISFOURFOURTHREESIX". 2. Write a function that uses Huffman Coding to generate the Prefix Codes of the letters in the string 15 (ignore spaces) generated in Question-1. The functions in Question-1 and 2 will be in a single program and sequence of execution should look something like Figure 1. M: Step 11. Enter Student ID: 1344 Step 12. Generated String: MYIDISFOURFOURTHREESIX Step 3. Prefix Codes (Generated Using Huffman Coding): 1101 1100 011 1011 S: 0011 0010 0001 0000 010 1010 1001 E: 111 x: 1000 R: Figure 1: Generating Prefix Codes Using Huffman Coding. 3. Illustrate in a typed report, the sequence of generating Prefix Codes using Huffman Coding for the same string just to verify the output of your program in Question-2. 7

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Medical Image Databases

Authors: Stephen T.C. Wong

1st Edition

1461375398, 978-1461375395

More Books

Students also viewed these Databases questions