Name

huffman_uncompress

Synopsis

int huffman_uncompress(const unsigned char *compressed, unsigned 
   char **original);

Return Value

Number of bytes in the restored data if uncompressing the data is successful, or -1 otherwise.

Description

Uses Huffman coding to uncompress a buffer of data specified by compressed. It is assumed that the buffer contains data previously compressed with huffman_compress. The restored data is written to a buffer returned in original. Since the amount of storage required in original may not be known to the caller, huffman_uncompress dynamically allocates the necessary storage using malloc. It is the responsibility of the caller to free this storage using free when it is no longer needed.

Complexity

O (n), where n is the number of symbols in the original data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset