Skip to content

Comments

Refact: inicio da adaptação do algoritmo para criar a arvore com o ti…#1

Merged
DevlTz merged 1 commit intomainfrom
refact/caio/alteracao_tipos
Sep 16, 2025
Merged

Refact: inicio da adaptação do algoritmo para criar a arvore com o ti…#1
DevlTz merged 1 commit intomainfrom
refact/caio/alteracao_tipos

Conversation

@ctrindadedev
Copy link
Collaborator

@ctrindadedev ctrindadedev commented Sep 16, 2025

Branch para implementar a lógica correta de geração de frequência

Mudanças chave:
A função abaixo, não estava compatível com os requisitos do projeto, reestruturei para manter a mesma logica de
while(in.get(c)), mas com condicionais para adequar-se ao novo tipo esperado de frequencia: std::map<std::string, uint64_t>

Como estava:
std::vector<uint64_t> freqs(256,0);
for(int i=1;i<argc;i++){
std::string fname = argv[i];
if(fname == "-o"){ ++i; break; }
std::ifstream in(fname, std::ios::binary);
if(!in){ std::cerr << "Cannot open " << fname << "\n"; continue; }
char c;
while(in.get(c)){
unsigned char uc = static_cast(c);
freqs[uc]++;
}

…po esperado e identificar palavras-chave de diferentes linguagens
@ctrindadedev ctrindadedev requested a review from DevlTz September 16, 2025 14:07
@DevlTz DevlTz merged commit a23d608 into main Sep 16, 2025
0 of 2 checks passed
Copy link
Owner

@DevlTz DevlTz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agradeço pela contribuição! É esse o caminho

@ctrindadedev ctrindadedev deleted the refact/caio/alteracao_tipos branch October 13, 2025 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants