Accepts the encoded bit-string and the same code dictionary returned by huffman_encode.
Returns the original text.
Internally you must:
Build a min-heap of leaf nodes keyed by character frequency.
Repeatedly merge the two lowest-frequency nodes until one tree remains.
Traverse the tree to assign prefix-free codes (left edge = ‘0’, right edge = ‘1’).
Handle edge cases: empty string, single unique character, and ties in frequency (use a stable tie-breaker such as insertion order or character value to keep the tree deterministic).
The implementation must be streaming-friendly: encoding walks the input once and decoding walks the bit-string once. Do not use any third-party compression libraries; implement the heap and tree yourself.