Question: Please help me answer this simple coding question using JAVA. Please make sure that your code meets all the requirements and the output your code
Please help me answer this simple coding question using JAVA. Please make sure that your code meets all the requirements and the output your code gets is exactly the same as the sample test case output given below in the question.

_________________________________________________________________________
This is the sample inputs/outputs:
Sample Input 0
emma dora ruth ziegellaub eichler 0111010100101011110011110000101101111001001001010001011101011011000000011100110111110
Sample Output 0
110011101111110100101011011100111101000010110111100100100101000101110101101100000001110011011111010011001011111110100000110001 miriam ruth ziegellaub
Sample Input 1
i love computer science 1100101110101100110111111011100011010101101100100111
Sample Output 1
110010111010000110111111011000000111000110010011111110100101010110011001110110100111 i live in nice
Implement a Huffman tree to encode and decode strings to and from variable-width encodings. Input Format The input will consist of two lines. The first line will be the string to derive your codes from and encode. Build your Huffman tree from this string. The second line will consist of a test string of Os and 1s to decode. The input will terminate with a blank line. For example, emma dora ruth ziegellaub eichler Constraints When you initially add characters to your priority queue, break frequency ties alphabetically. Thereafter, when adding a new node to the priority queue, it should come after all nodes already on the queue with the same frequency Output Format The output will consist of two lines. The first line will be the encoding of the first input string according to your tree. The second line will be the decoding of the second input string according to your tree. For example, miriam ruth ziegellaub
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
