Question: Description: In this assignment you are required to implement prefix - free codes using binary trees with linked nodes. For this, you have to write
Description:
In this assignment you are required to implement prefixfree codes using binary trees
with linked nodes. For this, you have to write the Java classes BinTree and TNode
in the same package. Class BinTree uses binary trees with linked nodes to represent
prefixfree codes. Class TNode represents the nodes of the binary tree. You also need to
perform the time and space complexity analysis of your algorithms.
You are not allowed to use any predefined Java methods other than those de
fined in the classes java.util.ArrayList, java.lang.String and java.lang.Math.
Definitions:
A prefixfree code used in data compression is a set of binary sequences sequences
of s and s such that none of them is a prefix of another. For instance, the set
A is a prefixfree code. On the other hand, the set
is not a prefixfree code because the sequence is a prefix of The elements of the
prefixfree code are referred to as binary codewords.
A prefixfree code can be used to encode a sequence of symbols from an alphabet B
ie convert the sequence of symbols into a bitstream as follows. Each symbol
in alphabet B c c c cn is assigned a distinct binary codeword. Then we
can encode any sequence of symbols by replacing every symbol by the corresponding
binary codeword. For instance, assume that alphabet B contains symbols. Then they
are c c c c Further, assume that symbol c is assigned c is assigned c
is assigned and c is assigned Consider now the following sequence of symbols
over the alphabet B: c c c c c c c This sequence is encoded into the bitstream
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
