【問題描述】
設計一個利用哈夫曼算法的編碼和譯碼系統,重復地顯示并處理以下項目,直到選擇退出為止。
【基本要求】
(1)初始化:鍵盤輸入字符集大小n、n個字符和n個權值,建立哈夫曼樹;
(2)編碼:利用建好的哈夫曼樹生成哈夫曼編碼;
(3)輸出編碼;
(4)設字符集及頻度如下表:
字符:A B C D E F
頻度:4 9 23 2 17 15
字符:G H I J K
頻度:1 2 3 3 4
課程設計:
1.求出在一個n×n的棋盤上,放置n個不能互相捕捉的國際象棋“皇后”的所有布局。
2.設計一個利用哈夫曼算法的編碼和譯碼系統,重復地顯示并處理以下項目,直到選擇退出為止。
【基本要求】
1) 將權值數據存放在數據文件(文件名為data.txt,位于執行程序的當前目錄中)
2) 分別采用動態和靜態存儲結構
3) 初始化:鍵盤輸入字符集大小n、n個字符和n個權值,建立哈夫曼樹;
4) 編碼:利用建好的哈夫曼樹生成哈夫曼編碼;
5) 輸出編碼;
6) 設字符集及頻度如下表:
字符 空格 A B C D E F G H I J K L M
頻度 186 64 13 22 32 103 21 15 47 57 1 5 32 20
字符 N O P Q R S T U V W X Y Z
頻度 57 63 15 1 48 51 80 23 8 18 1 16 1
I would like to thank my advisor, Dr. A. Lynn Abbott, for helping me throughout
my research, Gary Fleming and the rest of the people at NASA Langley who provided all
the flight information and image sequences, and my parents who supported me in my
decision to enter graduate study. Also, thanks to Phichet Trisirisipal and Xiaojin Gong
for helping when I had computer vision questions, and Nathan Herald for his help
creating an illustration.
g a w k或GNU awk是由Alfred V. A h o,Peter J.We i n b e rg e r和Brian W. K e r n i g h a n于1 9 7 7年為U N I X創建的a w k編程語言的較新版本之一。a w k出自創建者姓的首字母。a w k語言(在其所有的版本中)是一種具有很強能力的模式匹配和過程語言。a w k獲取一個文件(或多個文件)來查找匹配特定模式的記錄。當查到匹配后,即執行所指定的動作。作為一個程序員,你不必操心通過文件打開、循環讀每個記錄,控制文件的結束,或執行完后關閉文件。
I implement Dijkstra s Single Source Shortest Path, say SSP, algorithm for directed graphs using a simple data structure, say simple scheme, Fibonacci heaps, say F-heap scheme, and Pairing heaps, say P-heap scheme, and measure the relative performance of the three implementations.