實(shí)現(xiàn)最優(yōu)二叉樹(shù)的構(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ù)信息,。建立哈夫曼樹(shù)。
2.編碼:利用已建好的哈夫曼樹(shù)對(duì)明文文件進(jìn)行編碼,并存入目標(biāo)文件(哈夫曼碼文件)。
3.譯碼:利用已建好的哈夫曼樹(shù)對(duì)目標(biāo)文件(哈夫曼碼文件)進(jìn)行編碼,并存入指定的明文文件。
4.輸出哈夫曼編碼文件:輸出每一個(gè)字符的哈夫曼編碼。
Data Structures and Algorithms
with Object-Oriented Design Patterns in Java
Bruno R. Preiss
B.A.Sc., M.A.Sc., Ph.D., P.Eng.
Associate Professor
Department of Electrical and Computer Engineering
University of Waterloo, Waterloo, Canada
隨著光伏發(fā)電系統(tǒng)快速發(fā)展,以及電動(dòng)汽車(chē)充電樁的普及,傳統(tǒng)的剩余電流保護(hù)器無(wú)法滿足實(shí)際需求。介紹了一款B型剩余電流保護(hù)器,采用磁調(diào)制剩余電流互感器和零序電流互感器采集剩余電流。根據(jù)GB/T 22794—2017標(biāo)準(zhǔn)要求,可識(shí)別1 kHz及以下的正弦交流、帶和不帶直流分量的脈動(dòng)直流、平滑直流等剩余電流信號(hào)。經(jīng)信號(hào)調(diào)理電路將電壓信號(hào)送到單片機(jī)進(jìn)行采集和判斷。通過(guò)試驗(yàn)測(cè)試,該樣機(jī)在測(cè)試精度和速度上均符合國(guó)家標(biāo)準(zhǔn)的相關(guān)要求。The rapid development of photovoltaic power generation systems and the popularity of electric vehicle charging piles make the traditional residual current protective devices unable to meet the actual demand.This paper proposed a type B residual current protective device,which uses the magnetically modulated residual current transformer and the zero sequence current transformer to acquire the residual current.According to the requirements of GB/T 22794—2017,the type B residual current protective device can detect sinusoidal AC residual current of 1kHz and below 1kHz,pulsating DC residual current with and without DC component,smooth DC residual current and so on.The signal processing circuit sends the voltage signal to the MCU for acquisition and judgment.Through experimental tests,the device meets the relevant requirements of national standards in terms of test accuracy and speed.