class for huffman coding
More...
#include <huffman_encoding.h>
|
| huffman (std::vector< std::string > v={}, int64_t MAX_DEPTH=10) |
| constructor for huffman class
|
void | create_tree () |
| create_tree function creates the tree in recursive fashion, from the leafs up to the root
|
std::unordered_map< std::string, std::string > | decode () |
| decode function
|
◆ huffman()
huffman::huffman |
( |
std::vector< std::string > | v = {}, |
|
|
int64_t | MAX_DEPTH = 10 ) |
|
inlineexplicit |
constructor for huffman class
- Parameters
-
v | vector of strings(i.e. the text) |
MAX_DEPTH | maximum depth(number of bits) that we want to have(default = 10) |
◆ decode()
std::unordered_map< std::string, std::string > huffman::decode |
( |
| ) |
|
|
inline |
decode function
- Returns
- unordered_map<string, string>: the resulted encoding
The documentation for this class was generated from the following file:
- /Users/runner/work/AlgoPlus/AlgoPlus/src/machine_learning/image/encoders/huffman_encoding.h