in reply to Converting Stream of bits back into Stream of Characters it Encodes

It looks like you have a typo in your ternary statement:

$cur_node = $cur_bit ? $cur_node->right : $cur_node->left;

You've got a , where it looks like you mean to use a ? instead.

But I could be way off base on this one: I don't know much about Huffman encoding. If you post more of your code, some other monks might dig in and offer some more meaningful advice.

hth, and welcome to the monastery!
blyman
setenv EXINIT 'set noai ts=2'

  • Comment on Re: Converting Stream of bits back into Stream of Characters it Encodes
  • Download Code