小王子压缩算法

在这里插入图片描述
在《小王子》这本书中,the little prince反复出现,设想应该可以把它做为新的符号,从而起到压缩的效果。

霍夫曼编码依赖现有的符号边界,而本文要研究的,是寻找更好的符号边界。

市场上并不缺少压缩算法,研究小王子压缩算法,是为了设计CPU最优指令集。

原文是:
the little prince goes here the little prince goes where the little prince said i am the little prince

压缩为:
the little prince goes here (28,23)w(29,5)(29,18)said i am(28,18)

字典里:
the little prince goes
here
the little prince

内迭代:
the little prince
goes
here

至此,找到了3个新的“符号”!用A,B,C表示。

压缩后的正文:
A B C A B wC A said i am A

有些时候字典过大,需要舍弃概率低的。

搜集代码库,运行小王子压缩算法,留在字典里的,正是指令集需要的。这么一来,就求出了最优指令集。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值