algorithm - Should we Include spaces in Huffman Coding method
问题描述
When we encode using huffman coding method.Should we include spaces into consideration as well?
解决方案
The Huffman coding [wiki] encodes a stream of characters. These characters can include spaces, symbols, emoji characters, characters with diacritics, etc.
So we take spaces into account as well, otherwise if we would decode the string, the decoded string will not contain these spaces anymore.
In fact the Wikipedia article contains an image of a Huffman encoding tree that shows a space, at the righmost leaf:
推荐阅读
- java - 怎么防止block不显示,最后,如果没有文件的路径
- javascript - 如何知道嵌入式 ember 应用程序是否准备就绪
- json - 预测 JSON 有效负载 Splunk 警报
- r - 如何比较 R 中 ONE 数据框的行?
- python - 更改 sns 散点图中的图例
- c# - 从 MonoDevelop 调用服务时出错
- python - 在辅助监视器中打开 pygame 全屏窗口
- python - 基于python脚本改变django视图显示的理论
- c# - 使用带有字符串插值的 REGEX
- python-3.x - M2CryptoWin64 Python3.5 Windows10 Pycharm安装和__m2crypto导入错误