Computer Science Homework Solutions
Problem
#135406

C++ STL

See attached file for full problem description. Heaps, Binary Files, and Bit Sets

Attached file(s):
Attachments
Exercise 14.31.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Exercise 14.31.doc
Consider the following set of frequencies:

a:8 b:6 c:8 d:3 e:12 f:2 g:15

Construct a binary tree for the fixed-length codes

a->000, b->001, c->010, d->011, e->100, f->101, g->110

Answer the following questions about the codes and tree in part (a):

(i) Are the codes prefix codes?

(ii) Is the tree full?

(iii) What is the cost of the tree?

(iv) If your answer to part (ii) is no, modify the tree so it is
full, and compute the

cost of the modified tree.

Construct a Huffman tree. What is the cost of the tree?

What are the optimal prefix codes?

Solution Summary

Costruct a tree for optimal prefix codes.

Solution
What is this?
By OTA - Overall OTA Rating
Yanfang Li, PhD - 4.9/5
Purchase Cost Now
$2.19 CAD (was ~$31.92)
Included in Download
  • Plain text response
  • Attached file(s):
    • huff.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
  • Data Structures with C++ Using STL - Binary Trees. See attached file for full problem description.
  • 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 Huf ...
  • Huffman tree - Hi Please find correct answer and explain. Question: Consider the Huffman tree where the character frequencies are: Freq(A)=16, Freq(B)=8; Freq(C)=4;Freq(D)=2;Freq(E)=1;Freq(F)=1. The t ...
  • Data Structures with C++ Using STL - Binary Trees. See attached file for full problem description.
  • Binary Trees C++ - Write the definition of the function leavesCount that takes as a parameter a pointer to the root node of a binary tree and returns the number of leaves in a binary tree. Add this function to the class ...
Browse