Thanks...a lot....it's done.....
Type: Posts; User: Aberforth
Thanks...a lot....it's done.....
I have to create a Huffman Tree. I have prepared the Priority Queue. the problem is arising while creating the tree as it is generated bottom-up. Can you please give any idea about how to do that?
i am using double because probability will have a decimal part.
but when i am going to find the frequency , the decimal part should be entirely zero.
for example, the string be: aaaabbbbbbbbbbbccc...
actually the frequency should be an integer i.e,9.0000000000 and not 9.0000000006.
***Problem****In this program if the frequency is large (say, 9) the frequency shows it as 9.000000000006.
import java.io.*;
public class Freq {
public static void main(String[] args)
...