문제

Here is some of the code I have - My issue is in the generateTable() function:

I have created a Huffman Code tree and I want to output each node's location so that it appears like so:

10 111100
32 110
33 1010110110
34 10101111
38 01100110110101110011
39 1110101011
40 1010110111011101
41 011001101101010

Why won't that function write to the file properly? (I ask because that code was provided to me by my professor and I don't understand the problem.) When I open the file it is empty.

도움이 되었습니까?

해결책

If this is the exact code that was provided to you, then you should probably implement the orderNodes and readFileIn functions. They currently do nothing besides returning the empty ArrayHeap that is created in the line before they are called.

Also, I'm surprised that HTree.generateTable(...) even works, as it is not instantiated as an instance of HuffManNode (as far as I can see)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top