'Hey all, well I a recently got a Hufman algrorithm for BASIC. Sadly it
'was made only for PowerBasic and I use QuickBasic.  Could some of you
'guys out there with both QB/PB experience possibly modify the code ??
"A SIMPLE STRING TO BE ENCODED USING A MINIMAL NUMBER OF BITS""In:  ""Out: ""New: "'**********************************************************************
'   Huffman Encoding File Compression Technique
'
'   From: R Sedgwick.  Algorithms.  Reading, MA: Addison-Wesley.
'                      1984.  Second Ed.  pp  286 / 93.
'
'   Converted to Power Basic by M. Rosenberg CI$: [73707,2545]
'
' Count the frequency of each character in the message to be encoded (P. 287)
' Initialize the heap array to point to non-zero frequency counts (P. 290)
' Construct an indirect heap on the frequency values (P. 289)
' Construct the trie (P. 290)
' Reconstruct the information from the representation of the coding tree (P.291)
'    computed during the sifting process.
' Use the computed representations of the code to encode the string (P. 292)
"" : Hold$="""0"' Add a byte at the end that contains any left-over bits
"0"'**********************************************************************
' Unpack compressed string into character representation of binary
"" : NewText$="""0"' Decode compressed string
'All done
'Huffman
' Build and maintain an indirect heap on the frequency values (P. 139)
'     reversing the inequalities since we want the smallest values first.
'PqDownHeap
 
'**********************************************************************
"1"'Bin2Int