Bit Stream BenchmarksImplementing Bit Stream Manipulating Programs in Many languages huffmanDescriptionThe huffman benchmark decodes a huffman-encoded file. The structure of the file is as follows:
The huffman tree is encode in the following manner: An internal node:
A leaf node:
The NumofBits field in the file shows how many bits are used to encode the original file. The task of the program is to construct the huffman tree from the file and use this tree to decode the data. The program should not use any tricks such as lookup tables, etc. to do the decoding but it should simply use the bitstream to traverse the tree until it reaches a leaf. The contents of the leaf should then go into the result. When traversing the tree, the left subtree should be chosen if the next bit is 0 and the right subtree should be chosen if the next bit is 1. Example:Huffman Tree:
Encoded bitstream = 00100011 00001101 11011011 0 Time MeasurementThe time for this benchmark should be taken when the file has been loaded but before the tree has been constructed until the entire bitstream is decoded. Functional languages are not allowed to use destructive updates or preallocated buffers in the time-sensitive part. Iterations: 10Source CodeThis benchmark has been implemented in the following languages:
Example input and output:testdata.huffman and testdata.huffman.out last updated 2 years ago # Comments<a href=http://sharon786.blog.espresso.repubblica.it/ >phentermine</a> [URL=http://sharon786.blog.espresso.repubblica.it/] phentermine [/URL] 2 years ago # |
<a href=http://www.carookee.com/forum/somaa677/SOMA_Buy_Cheap_Soma_Online.12401637.0.01105.html >soma</a> [URL=http://www.carookee.com/forum/somaa677/SOMA_Buy_Cheap_Soma_Online.12401637.0.01105.html] soma [/URL]
2 years ago #