Question

5. Find the Huffman codes for the characters in the table below. Assume that your minimum priority queue is represented as a

0 0
Add a comment Improve this question Transcribed image text
Answer #1

24 14 z (10) a (7) 7 b (2) c (5)

codewords:
-----------
a -> 00
b -> 010
c -> 011
z -> 1
Add a comment
Know the answer?
Add Answer to:
5. Find the Huffman codes for the characters in the table below. Assume that your minimum...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • *7. a. Construct the Huffman tree for the following characters and frequencies: Character      c       d      g      ...

    *7. a. Construct the Huffman tree for the following characters and frequencies: Character      c       d      g       m      r       z Frequency   28     25       6      20      3      18 b. Find the Huffman codes for these characters.

  • C language huffman This exercise will familiarize you with linked lists, which you will need for...

    C language huffman This exercise will familiarize you with linked lists, which you will need for a subsequent programming Getting Started assignment Overview Requirements Getting Started Submit Start by getting the files. Type 264get hw13 and then cd hw13 from bash. Pre-tester You will get the following files: Q&A Updates 1. huffman.h: An empty header file, you have to define your own functions in this homework. 2. huffman.c: An empty c file, you have to define your own functions in...

  • 3. Apply the Huffman algorithm according to the frequency chart shown below. (10 points) a. Show...

    3. Apply the Huffman algorithm according to the frequency chart shown below. (10 points) a. Show your work for combining the characters and frequencies. b. Assemble and show the finished tree. c. State the encoding for each character. d. Show your calculation and state the compression ratio. e. Using your Huffman tree from this question, encode the string ABACABAD. f. Using your Huffman tree from this question, decode the bit-string 100010111001010. symbol A B C D frequency 0.4 0.1 0.2...

  • Using Kruskal’s Algorithm find the minimum spanning tree of the Graph below. Requirements… Show each step...

    Using Kruskal’s Algorithm find the minimum spanning tree of the Graph below. Requirements… Show each step but using a priority queue. Where we show each step of the priority queue list. Assume that vertices of an MST are initially viewed as one element sets, and edges are arranged in a priority queue according to their weights. Then, we remove edges from the priority queue in order of increasing weights and check if the vertices incident to that edge is already...

  • For this assignment, you will write a program to work with Huffman encoding. Huffman code is...

    For this assignment, you will write a program to work with Huffman encoding. Huffman code is an optimal prefix code, which means no code is the prefix of another code. Most of the code is included. You will need to extend the code to complete three additional methods. In particular, code to actually build the Huffman tree is provided. It uses a data file containing the frequency of occurrence of characters. You will write the following three methods in the...

  • 5. Consider a priority queue of strings with an integer priority. The queue us implemented as...

    5. Consider a priority queue of strings with an integer priority. The queue us implemented as a min heap using a 0-based array of size 8 with methods push(entry, priority) and pop(). Determine the priority queue contents, represented both as an array and as a tree, at the points indicated below during the following operations on the ADT. Write down the queue contents after the operation on the given line is executed. 1. priority_queue<string, int> pq; 2. pq.push("start", 10); 3....

  • This is for C++ Write a program that reads in a sequence of characters entered by...

    This is for C++ Write a program that reads in a sequence of characters entered by the user and terminated by a period ('.'). Your program should allow the user to enter multiple lines of input by pressing the enter key at the end of each line. The program should print out a frequency table, sorted in decreasing order by number of occurences, listing each letter that ocurred along with the number of times it occured. All non-alphabetic characters must...

  • What to submit: your answers to exercises 1, 3, and 4 and separate the codes to...

    What to submit: your answers to exercises 1, 3, and 4 and separate the codes to each question. Using your solution to question 3 of Lab Practice 2, modify it to create a class that contains a static method; the method takes a string as a parameter and returns a boolean value indicating whether the parameter string has repeated characters in it or not. That is, return true if there is at least one character which appears more than once...

  • 14 18 11 10 19 16 23 28 15 21 Again, recall that in a Java...

    14 18 11 10 19 16 23 28 15 21 Again, recall that in a Java program, a binary heap is stored as an array with the first element in position [O] unused, in order to simplify the swim() and sink() operations. Let us denote the unused element of the array with the symbol "#". Therefore, the above complete binary tree will be represented by the following array: T[ 0..13 ] = [ #, 5, 6, 7, 14, 18, 11,...

  • PROGRAM DESCRIPTION Using the given class definitions for either C++, create a minimum heap that stores...

    PROGRAM DESCRIPTION Using the given class definitions for either C++, create a minimum heap that stores integers and and implements a minimum priority queue. (Your program can be "hard coded" for integers - it does not need to use templates, generics, or polymorphism.) Your data structure must always store its internal data as a heap. Your toString function should return a string with the heap values as a comma separated list, also including the size of the heap as well....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT