首页 开发技术 C++     /    自顺应霍夫曼编码(C++)

自顺应霍夫曼编码(C++)

上传者: yulin_wyy | 上传时间:2017/6/9 18:05:54 | 文件大小:3KB | 文件类型:rar
自顺应霍夫曼编码(C++)
自顺应霍夫曼编码的C++版本简单实现classAdaptiveTree{public: AdaptiveTree(introotNum); AdaptiveTree(introotNum,stringstr); voidswap(intfirst,intsecond); //swaptwonodesofthetree voidinitalCode(); //initializingthedata stringchar2code(unsignedcharletter); //locatethecharacterinthetreewithitscorrespondingbinarystringandreturnthestring stringchar2binary(unsignedcharletter); //translatingthecharactertothe8-bitbinarystring unsignedcharbinary2char(stringbin); //translatingthebinarystring:bintothecorrespondingcharacter intspawn(unsignedcharletter); //addanewcharactertotheoriginaltree voidupdateTree(unsignedcharnewchar); //updatethetree inthighestInBlock(intcount); //returnthehighestnodetobeexchanged voidsetString(stringstr); // stringdecodingStr()const; voidencoding(); stringdecoding(); unsignedcharcode2char(stringbincode); staticintsize(); stringbinStr()const;//returnthebinarystringofstring:tempStringprivate: voidrun(); intfindchar(unsignedcharletter); //locatetheletterinthetree stringtempString; //tempstringtobeencodedneededtobestoredhere stringdeStr;//usedforstoringthedecodingstring stringbin;//usedforstoringtheresultofencodingprocess /*AdaptiveTreedatamembers*/ HuffmanTree*tree;introot; /*AdaptiveTreeconstants*/ staticintALPH_SIZE;//sizeofthealphabetstaticunsignedcharnone;//notaunsignedcharacterstaticunsignedcharNYT;//NotYettransmittedcode};

文件下载

资源详情

[{"title":"(1个子文件3KB)自适应霍夫曼编码(C++)","children":[{"title":"adaptiveHuffmanCoding.cpp <span style='color:#111;'>11.50KB</span>","children":null,"spread":false}],"spread":true}]

评论信息

  • qq_43281733:
    可以的,没有问题,代码运行正常2018-12-23
  • qq_26744899:
    感谢楼主分享2017-12-04
  • Clam_WH:
    很好的资源很有参考价值2017-02-17
  • lanseyouling123:
    开始自己编写难度很大,有了这程序难度大大的降低了2015-09-24
  • 德以明理_周:
    huffman自适应编码,看不懂代码啊2015-05-05

免责申明

【好快吧下载】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【好快吧下载】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【好快吧下载】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,8686821#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明