Shannon编码步骤:
1、将信源符号按概率从大到小的顺序排列,
p(a1)≥ p(a2)≥…≥ p(an)
2、确定满足下列不等式的整数Ki,
-log2 p(ai) ≤ Ki < 1-log2 p(ai)
3、令P(a1)=0,用Pi表示第i个码字的累加概率,
Pi=sum_{k=1}^{i-1} p(ak)
4、将Pi用二进制表示,并取小数点后Ki位作为符号ai的编码。
Shannon coding steps:
1. The source symbols are arranged in order of probability from large to small
2. Determine the integer ki satisfying the following inequality
3. Let P(A1)= 0, and PI denotes the cumulative probability of the i-th codeword,
4. PI is represented in binary system,and Ki bit after decimal point is taken as the code of symbol AI. (2020-09-06, C/C++, 1KB, 下载0次)
数据结构:顺序栈的基本操作,符合国内oj检验
This is the answer of oj system in cn. (2019-11-30, C/C++, 1KB, 下载0次)
1 输入:信源符号个数r,以及r-1个信源的概率分布p;
2 输出:每个信源符号对应的Huffman编码的码字
The 1 input is the number of source symbols R, and the probability distribution P of R-1 sources.
2 output: each source symbol corresponds to the Huffman encoded codeword. (2018-04-03, C/C++, 4971KB, 下载1次)
信息量的计算,包括信源熵,条件熵,联合熵和交互熵四种熵值计算
The calculation of the amount of information (2017-12-11, C/C++, 5KB, 下载5次)
来自于http acm zju edu cn上的一个名叫Fece的用C写的程序 (2017-12-06, C/C++, 3KB, 下载1次)
http://www.pudn.com/Download/item/id/1512552448377172.html
微软、腾讯、金山等企业面试题,数据结构、算法一百道
Data structure, algorithm 100 cases (2014-02-24, C/C++, 268KB, 下载3次)
由于换季,ACM商场推出优惠活动,以超低价格出售若干种商品。但是,商场为避免过分亏本,规定某些商品不能同时购买,而且每种超低价商品只能买一件。身为顾客的你想获得最大的实惠,也就是争取节省最多的钱。经过仔细研究过,我们发现,商场出售的超低价商品中,不存在以下这种情况:
N(3<=n)种商品C1,C2,…,Cn,其中Ci和Ci+1是不能同时购买的(i=1,2,…,n-1),而且C1和Cn也不能同时购买。
请编程计算可以节省的最大金额数。
shoping lest (2013-09-24, C/C++, 1KB, 下载1次)
1)自选存储结构,输入含n个顶点(用字符表示顶点)和e 条边的图G;
(2)求每个顶点的度,输出结果;
(3)指定任意顶点x为初始顶点,对图G作DFS遍历,输出DFS 顶点序列(提示:使用一个栈实现DFS);
(4)指定任意顶点x为初始顶点,对图G作BFS遍历,输出BFS 顶点序列(提示:使用一个队列实现BFS);
(5)输入顶点x,查找图G:若存在含x的顶点,则删除该结点及 与之相关连的边,并作DFS遍历(执行操作3);否则输出信 息“无x”;
(6)判断图G是否是连通图,输出信息“YES”/“NO”;
(7)如果选用的存储结构是邻接矩阵,则用邻接矩阵的信息生 成图G的邻接表,即复制图G,然再执行操作(2);反之亦然。
i don t know. (2012-11-09, C/C++, 2KB, 下载5次)
哈夫曼编码是一种有效的信源编码。能够实现哈夫曼编码功能,误码率低。
This c++ program could reach haffuman, and it has low error rate. (2012-06-04, C/C++, 2KB, 下载4次)
题目:企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10 ;利润高
于10万元,低于20万元时,低于10万元的部分按10 提成,高于10万元的部分,可可提
成7.5 ;20万到40万之间时,高于20万元的部分,可提成5 ;40万到60万之间时高于
40万元的部分,可提成3 ;60万到100万之间时,高于60万元的部分,可提成1.5 ,高于
100万元时,超过100万元的部分按1 提成,从键盘输入当月利润I,求应发放奖金总数?
is my life (2011-11-19, C/C++, 1KB, 下载2次)
企业发放的奖金根据利润提成。利润(I)低于或等于10万元时,奖金可提10 ;利润高
于10万元,低于20万元时,低于10万元的部分按10 提成,高于10万元的部分,可可提
成7.5 ;20万到40万之间时,高于20万元的部分,可提成5 ;40万到60万之间时高于
40万元的部分,可提成3 ;60万到100万之间时,高于60万元的部分,可提成1.5 ,高于
100万元时,超过100万元的部分按1 提成,从键盘输入当月利润I,求应发放奖金总数?
程序分析:请利用数轴来分界,定位。注意定义时需把奖金定义成长整型。
Corporate bonuses based on profit commission. Profit (I) less than or equal to 10 million, money can be raised 10 high-profit
$ 100,000, less than 20 million, less than 10 million part of the 10 commission, more than 10 million parts, put cocoa
To 7.5 200000-400000 between, more than 20 million part, can be 5 commission 400000-600000 is higher than between
Part of $ 400,000, can be 3 commission 600000-1000000 between, more than 60 million part, can commission of 1.5 , higher than the
1 million yuan, more than 1 million parts by 1 commission, monthly profits from the keyboard input I, the total demand to be bonuses?
Program analysis: Please use a few axes to boundaries, location. Note that the definition needs to grow up bonus define an integer. (2011-10-14, C/C++, 2KB, 下载2次)
ZOJ 1087 Cracking the code
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1087
ZOJ 1087 Cracking the code
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1087 (2011-04-06, C/C++, 1KB, 下载1次)
信息论中,将给定的信源符号概率,通过哈夫曼编码成一列二元码。
Information theory in a given source symbol probability by Huffman coding into a binary code. (2010-06-19, C/C++, 1KB, 下载3次)
算法题面试大全,收集的很多大的软件企业的面试算法题目
Algorithm interview questions Daquan, collected a lot of big software companies subject of the interview method (2010-06-16, C/C++, 85KB, 下载16次)
本文介绍了动态规划的基本原理及其在企业经营决策中的运用方法
Dynamic Programming in the application of business decision-making (2009-11-19, C/C++, 225KB, 下载2次)
一元稀疏多项式计算器的基本功能是:
(1)输入并建立多项式;
(2)输出多项式,输出形式为整数序列:n,c1,e1,c2,e2,….,cn,en, 其中n是多项式的项数,ci和ei分别是第I项的系数和指数,序列按照指数降序排列;
(3)多项式a和b相加,建立多项式a+b
(4)多项式a和b相减,建立多项式a-b.
Sparse Polynomial calculator a dollar a basic function is to: (1) input and the establishment of polynomials (2) the output polynomial, the output sequence of the form of an integer: n, c1, e1, c2, e2, ...., Cn , en, in which n is the number of polynomial, ci and ei, respectively, is the first I of the coefficient and index, sequence in accordance with the index in descending order (3) polynomials a and b are added together to establish polynomial A2B ! b (4) polynomials a and b-phase reduction, the establishment of polynomial ab. (2008-09-19, C/C++, 11KB, 下载14次)
数据结构课程设计 排序算法的 比较 完整 源码加文档
Data structure the curriculum design of the sorting algorithm relatively complete source code plus documentation (2008-07-01, C/C++, 32KB, 下载73次)
判定一个码是否为唯一可译码
1. 已知:信源符号个数为q,码符号集为C
2. 输入:任意一个码。码字个数和每个具体的码字在运行时从键盘输入。
3. 输出:判断(是否唯一可译码)
1 yards to determine whether only one decoder. Known: the number of source symbols for q, code symbol set for C2. Input: arbitrary one yards. Code word and every specific number of characters in the run-time code from the keyboard input. 3. Output: to determine (whether or not the only decoding) (2008-06-04, C/C++, 1KB, 下载16次)
zju 1007 Numerical Summation of a Series
http://acm.zju.edu.cn/show_problem.php?pid=1007
zju 1007 Numerical Summation of a Series ht tp :// acm.zju.edu.cn/show_problem.php pid = 100 7 (2007-05-13, C/C++, 1KB, 下载56次)