In 1953, David A. Huffman published his paper "A Method for the Construction of Minimum-Redundancy Codes", and hence printed his name in the history of computer science. As a professor who gives the final exam problem on Huffman codes, I am encountering a big problem: the Huffman codes are NOT unique. For example, given a string "aaaxuaxz", we can observe that the frequencies of the characters 'a', 'x', 'u' and 'z' are 4, 2, 1 and 1, respectively. We may either encode the symbols as {'a'=0, 'x'=10, 'u'=110, 'z'=111}, or in another way as {'a'=1, 'x'=01, 'u'=001, 'z'=000}, both compress the string into 14 bits. Another set of code can be given as {'a'=0, 'x'=11, 'u'=100, 'z'=101}, but {'a'=0, 'x'=01, 'u'=011, 'z'=001} is NOT correct since "aaaxuaxz" and "aazuaxax" can both be decoded from the code 00001011001001. The students are submitting all kinds of codes, and I need a computer program to help me determine which ones are correct and which ones are not.
1
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to restore this property. Figures 1-4 illustrate the rotation rules.Now given a sequence of insertions, you are supposed to tell the root of the resulting AVL tree.
2021-11-10 18:59:06 5KB 陈越 数据结构 AVLTree 平衡二叉树
1
本题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。L1和L2是给定的带头结点的单链表,其结点存储的数据是递增有序的;函数Merge要将L1和L2合并为一个非递减的整数序列。应直接使用原序列中的结点,返回归并后的带头结点的链表头指针。
2021-10-10 21:08:20 3KB 数据结构 陈越 顺序链表合并
1
很精华的数据结构,我大学老师给我的
2021-09-29 23:35:58 4.22MB 数据结构
1
伪代码文件为txt文件,其它所有的均为.c文件,不同于一些只提供无用链接不同。
2021-09-08 18:07:44 133KB 数据结构 c语言 源代码
1
该课件与浙大陈越C语言程序设计的教材(第2版)配套,非常好用
2021-07-01 18:47:32 3.07MB 程序设计 c语言
1
MOOC中国大学数据结构(陈越/何钦铭)每周C 语言作业答案
2021-06-25 10:02:27 62KB MOOC C语言
浙大数据结构的ppt
2021-05-31 14:02:29 16.32MB 数据结构
1
用于数据结构复习,浙江大学陈越版,绝对可用,精炼总结,希望能有帮助
2021-05-20 22:43:28 13.92MB 数据结构 浙大 总结
1