Build a Huffman Encoding Tree in JAVA using the frequency table shown below. Resolve ties by giving single letter groups precedence over multiple letter groups, then alphabetically. Do not worry about punctuation or capitalization.

Print out the tree by doing a preorder traversal. Print the resulting code. An example is given below for a 3-letter alphabet. You may use any reasonable format. All input and output should be read from named txt files and written to named txt files. Only standard JAVA should be used the use of standard libraries is restricted to I/O calls and standard math functions. See image.

In a word file named Summary write an analysis considering whether any useful data compression occurred with this method. Compare it to conventional encoding.

How would your results be affected by using a different scheme to break ties such as giving precedence to alphabetical ordering and then to the number of letters in the key? What other structures did you use and why?

Encode the following strings, plus several others of your choice :

Sally sells seashells by the seashore. Peter Piper picked a peck of pickled peppers a peck of pickled peppers Peter Piper picked. Houston, the Eagle has landed. Is that your final answer?

Decode the following strings:


A - 19
B - 16
C - 17
D - 11
E - 42
F - 12
G – 14
H – 17
I - 16
J - 5
K - 10
L - 20
M - 19
N - 24
O - 18
P - 13
Q - 1
R - 25
S - 35
T - 25
U - 15
V - 5
W - 21
X - 2
Y - 8
Z - 3
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.