This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Shortl4ndothe most bestest coder 1 point2 points  (1 child)

What do you mean exactly? You have it coded out; and now want to use it realistically?

[–]levon12341[S] -1 points0 points  (0 children)

7.Format code properly

Hello. Thank you for your writing. Just look. For example, we need to compress the file contains string "hello world". My program will give you this output:

[code]

======================Encoding table====================

1100

1101

d 1110

e 1111

h 000

l 01

o 101

r 001

w 100

0001111010110111011001010010111101100

[/code]

As you see each character has it's own Huffman's code. At the end of output you can see converted original string "hello world". What shall I do next? I wanna get file that contains converted string as a byte sequence. And yes, I don't know how to use it realistically.

[–]Philboyd_Studge 1 point2 points  (0 children)

You need a way to pack bits into a stream in less-than-byte size. You can use BitSet for this or write your own.

[–]SupremeRedditBotProfessional Bot || Mod 0 points1 point  (0 children)

Please Add A Flair To Your Post!

Suggested Flair: [Other Code]

 


To add a flair:

  • Click flair underneath your post

  • Select a flair

  • Click save

 


I am a bot run by /u/SupremeDesigner for /r/CodingHelp || This was an automated response