I'm working in a program which compress a file
I decided to use the huffman algorithm to encode (the Bytes Or character)

but huffman algorithm depends on the frequency of each letter and If I calculate the frequency for each letter, it will takes long time.

so what should I do?

How can I encode the bytes??

Should I encode words and calculate the frequency for each word?

but if I did it, I would face the same problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.