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!)
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!)