还未生成 字符编码
已生成权重表 已经构建huffman树 但未懂
This commit is contained in:
commit
04551008b3
7
huffman_tree.cpp
Normal file
7
huffman_tree.cpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
//
|
||||||
|
// Created by dongl on 22-11-11.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <huffman_tree.h>
|
||||||
|
|
||||||
|
|
11
main.cpp
Normal file
11
main.cpp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <huffman_code.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
auto code = new HTCode();
|
||||||
|
code->Open("/home/dongl/code/cpp_data_struct/src/test.txt");
|
||||||
|
code->CreateHuffmanCode();
|
||||||
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
17
test.txt
Normal file
17
test.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
China is an ancient civilization with a long history, thousands of years of culture in the world, but among the many talented people and emperors and generals in ancient times, I love one character, he is none other than Cao Cao, a famous tyrant during the Three Kingdoms period.
|
||||||
|
|
||||||
|
Whether in Peking Opera or in people's discussions, whenever they talk about Cao Cao, people will always classify him as a white-faced villain, calling him a treacherous and cunning villain.
|
||||||
|
|
||||||
|
Everyone hopes that their life can be happy and spent peacefully. However, in that era of change, killing and constant development, it is a society of the jungle, and in that environment, either you die or I live. Who would dare to live like that? Perhaps Cao Cao's insidious cunning was his character, but he also relied on that character to protect himself and the country he had built.
|
||||||
|
|
||||||
|
So, no matter what kind of person he is, it's okay, and I still like him the most.
|
||||||
|
|
||||||
|
Of course, when it comes to Cao Cao, we have to talk about the Battle of Guandu, which was fought in an earth-shattering and wonderful manner.
|
||||||
|
|
||||||
|
At that time, Yuan Shao's forceszzzzzzzzzzzzzzzzzz were the most powerful among the heroes, and Cao Cao made arrangements in advance, and after solving all the situation, he personally led his army to hide in Guandu and prepare to meet Yuan Shao.
|
||||||
|
|
||||||
|
Liu Bei also defected to Cao Cao for a time, butzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz that was only a stopgap measure, and after defeat, he defected to Yuan Shao.
|
||||||
|
|
||||||
|
Yuan Shao was the most powerful force in the north at that time, and the most powerful enemy of Cao Cao to unify the north. The Yuan family was already very powerful, and then its strength increased greatly, with hundreds of thousands of troops. Because Yuan's soldiers had enough food, they didn't take Cao Cao seriously at all. Yuan Shao selected 100,000 elite soldiers and 10,000 war horses, aiming to eliminate Cao Cao in one fell swoop.
|
||||||
|
|
||||||
|
Yuan Shao led his army to attack Cao Cao. Cao Cao's strength was much weaker than Yuan Shao's, and the area south of the Great River occupied by Cao Cao was
|
Loading…
x
Reference in New Issue
Block a user