實(shí)現(xiàn)最優(yōu)二叉樹的構(gòu)造;在此基礎(chǔ)上完成哈夫曼編碼器與譯碼器。 假設(shè)報(bào)文中只會(huì)出現(xiàn)如下表所示的字符:
字符 A B C D E F G H I J K L M N
頻度 186 64 13 22 32 103 21 15 47 57 1 5 32 20 57
字符 O P Q R S T U V W X Y Z , .
頻度 63 15 1 48 51 80 23 8 18 1 16 1 6 2
要求完成的系統(tǒng)應(yīng)具備如下的功能:
1.初始化。從終端(文件)讀入字符集的數(shù)據(jù)信息,。建立哈夫曼樹。
2.編碼:利用已建好的哈夫曼樹對(duì)明文文件進(jìn)行編碼,并存入目標(biāo)文件(哈夫曼碼文件)。
3.譯碼:利用已建好的哈夫曼樹對(duì)目標(biāo)文件(哈夫曼碼文件)進(jìn)行編碼,并存入指定的明文文件。
4.輸出哈夫曼編碼文件:輸出每一個(gè)字符的哈夫曼編碼。
C-N解偏微分方程的程序。解的是定步長(zhǎng)的拋物型偏微分方程:
du/dx - a * d2u/dx2 = 0
在程序中可以更改 a 的值以實(shí)現(xiàn)不同系數(shù)的解。在循環(huán)中改變 a 的值以實(shí)現(xiàn)變系數(shù). 該說明在壓縮包是也有
求標(biāo)準(zhǔn)偏差
> function c=myfunction(x)
> [m,n]=size(x)
> t=0
> for i=1:numel(x)
> t=t+x(i)*x(i)
> end
> c=sqrt(t/(m*n-1))
function c=myfunction(x)
[m,n]=size(x)
t=0
for i=1:m
for j=1:n
t=t+x(i,j)*x(i,j)
end
end
c=sqrt(t/(m*n-1
求標(biāo)準(zhǔn)偏差
> function c=myfunction(x)
> [m,n]=size(x)
> t=0
> for i=1:numel(x)
> t=t+x(i)*x(i)
> end
> c=sqrt(t/(m*n-1))
function c=myfunction(x)
[m,n]=size(x)
t=0
for i=1:m
for j=1:n
t=t+x(i,j)*x(i,j)
end
end
c=sqrt(t/(m*n-1
求標(biāo)準(zhǔn)偏差
> function c=myfunction(x)
> [m,n]=size(x)
> t=0
> for i=1:numel(x)
> t=t+x(i)*x(i)
> end
> c=sqrt(t/(m*n-1))
function c=myfunction(x)
[m,n]=size(x)
t=0
for i=1:m
for j=1:n
t=t+x(i,j)*x(i,j)
end
end
c=sqrt(t/(m*n-1
求標(biāo)準(zhǔn)偏差
> function c=myfunction(x)
> [m,n]=size(x)
> t=0
> for i=1:numel(x)
> t=t+x(i)*x(i)
> end
> c=sqrt(t/(m*n-1))
function c=myfunction(x)
[m,n]=size(x)
t=0
for i=1:m
for j=1:n
t=t+x(i,j)*x(i,j)
end
end
c=sqrt(t/(m*n-1