ViNiNine 2016-12-04 04:41 采纳率: 0%
浏览 1453

C++数据结构 写一个函数生成哈夫曼编码 要求如下

(1) The function prototype should be like this: void HuffmanCode(double weights[], int size);

(2) Inside the function, a variable like char **hcodes should be declared, and the space for huffman codes must be allocated dynamically using new[] operation;

(3)When building huffman tree, a minimum heap must be created by repeating the adjustDown() operation;

(4) After outputting all the huffman codes, the dynamically allocated space must be released;

  • 写回答

1条回答

  • devmiao 2016-12-04 06:15
    关注
    评论

报告相同问题?

悬赏问题

  • ¥20 fluent无法启动
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题
  • ¥50 Oracle Kubernetes服务器集群主节点无法访问,工作节点可以访问
  • ¥15 LCD12864中文显示
  • ¥15 在使用CH341SER.EXE时不小心把所有驱动文件删除了怎么解决
  • ¥15 gsoap生成onvif框架
  • ¥15 有关sql server business intellige安装,包括SSDT、SSMS。