AlgoPlus v0.1.0
Loading...
Searching...
No Matches
huffman Class Reference

class for huffman coding More...

#include <huffman_encoding.h>

Public Member Functions

 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

Detailed Description

class for huffman coding

Constructor & Destructor Documentation

◆ huffman()

huffman::huffman ( std::vector< std::string > v = {},
int64_t MAX_DEPTH = 10 )
inlineexplicit

constructor for huffman class

Parameters
vvector of strings(i.e. the text)
MAX_DEPTHmaximum depth(number of bits) that we want to have(default = 10)

Member Function Documentation

◆ 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: