Computer Science Homework Solutions
Problem
#1651

Constructing an optimal Huffman code and tree.

Suppose characters a, b, c, d, e, f, g, h, i, j, k have probabilities 0.01, 0.03, 0.03, 0.05, 0.05, 0.07, 0.09, 0.12, 0.13, 0.20, 0.22, respectively. Construct an optimal Huffman code and draw the Huffman tree.

Use the following rules:
a. Left: 0, right: 1
b. For identical probabilities, group them from the left to right.

What is the average code length?

Solution
What is this?
By OTA - Overall OTA Rating
Jie Xiong, MSc (IP) - 3.1/5
Purchase Cost Now
$2.19 CAD
Included in Download
  • Plain text response
  • Attached file(s):
    • data-sol2-redone.doc
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Using String Methods to Count Characters - ****This needs to be written in Java***** Generally, word processing programs can count and then display the number of characters in a document, either including or excluding blank characters. Usin ...
  • Effect of Code in C - ***This is in C*** char Ch; while ((Ch=getchar()) !=';') putchar (Ch); Will this code: a. read and write characters until something other than a ; is read. b. read characters up to ...
  • Write a stringlast function in C++ to find the last n characters in a string. - The C++ libraries on strings have several functions that can be used to handle various string operations. Write a function called stringlast that can be used to find the last n characters in a string ...
  • Please do the following Using VB.NET - 1) I want the form to be like the one in the zipped file named "Example". When Analyzing text or Analyzing File it should use the same text boxes. It has to be (Identical) exactly to the form in "exa ...
  • Program that uses the function strncmp to compare two strings input by the user - I need a program that uses the function strncmp to compare two strings input by the user. The Program should input the number of characters to compare. The program should state whether the first strin ...
Browse