I have written program to obtain the code for each char as shown in the program output.
enter some text: nslfaslfjasfj text = "nslfaslfjasfj"
a:2
f:3
j:2
l:2
n:1
s:3
Huffman Algorithm Below is "CHAR CODE":
n code:111
j code:110
f code:10
s code:01
l code:001
a code:000
My next step should be storing the above in structure and comparing it my original text = "nslfaslfjasfj" to encode as "11101.....so on".
I am finding a problem in storing "CHAR CODE" in structure. Should it be stored as string like string s="111" and then stored in the strucuture?.. Thanks in advance.