int main()
{
int numsymbols;
ptr p, q, r;
cout << "Introduce el numero de simbolos: ";
cin >> numsymbols;
for (int i = 0; i < numsymbols; i++)
create(i);
void twosmall(ptr &p, ptr &q, int numnodes)
{
int min1 = 9999;
int min2 = 9999;
p = null;
q = null;
for (int i = 0; i < numnodes; i++)
{
if (node[i]->parent == null)
{
if (node[i]->freq < min1)
{
min2 = min1;
min1 = node[i]->freq;
q = p;
p = node[i];
}
else
if (node[i]->freq < min2)
{
min2 = node[i]->freq;
q = node[i];
}
}
}
}
every step is to create the appropriate node and link it to an array that will represent my tree, and then at each iteration seeks the 2 lowest probability nodes and creates a new one whose probability is the sum of the 2 lowest
is there any way to start decoding from a .huf file that already has the text codified in huffman?