I have a project as an assignment and I haven't implemented it yet, but I have the idea for it figured out, but the last step is something that I can't figure out, how to even implement. This is what I want from my project:
I want to create a text based compression model using java. I will create a Huffman encoder and decoder and store these programs in both computers: PC1 and PC2.
Now in PC1, i will give a "data.txt" file as an input to my Huffman encoder program and it will create another file called "binary.txt" with 0's and 1's. Now instead of transmitting the "data.txt" file, I will email "binary.txt" file to PC2 and using the decoder java program there, I will try to recreate "data.txt". This way I would have compressed my file using Huffman mechanism.
So the problem is that I am new to java (which doesn't scare me as of now), and I don't know how to export the tree data structure from PC1 along with "binary.txt" file because for Huffman decoding (later on in PC2), I will need to have access to the Huffman tree which was created in PC1, so how do I go about solving or rather creating this project?
Are there any other better ways to implement this project? Hashmap or splay tree or any other data structure?
Thanks