C++ Homework for Week 6.
Be prepared to demonstrate this program
for your TA in your designated tutorial slot in week 7. (That's the week after
reading week.)
Over the next
few weeks I will be asking you to implement various stages of a Huffman data
compression scheme. This week all you have to do is to compute the so called
"probabilities" of characters in some text. You need to use file I/O to read in
a text file. Reading in characters one at a time you can obtain the occurrence
frequency of each character. It will be most convenient if you use your binary
search tree to help in computing character frequencies. The probability for any
given character is just its frequency divided by the total number of characters
in the text. To demonstrate your program print a listing of the characters in
the file together with the probability of the
character.
Posted: Wed - February 7, 2007 at 12:45 PM