MateusZitelli / js-tree-algorithms

GNU General Public License v3.0
1 stars 0 forks source link

Huffman Coding #11

Closed cirocosta closed 10 years ago

cirocosta commented 10 years ago

This PR adds the naive version of Huffman Coding (part of Deflate).

It uses a composite array that we sort n times (such baddd!!1!). In a better way we sould have a extract-min method which would use a priority queue. I thought that we could keep with this naive approach for now as it is more easy to figure out what's going on (see the video) and we haven't implemented a JS version of Priority Queue / any other heap (eat your own dog food!).

It also lacks docs, no time now :pensive: (what a bad pr!)