Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Develop a Huffman Tree that uses a template class. Implement the template class

ID: 3857014 • Letter: D

Question

Develop a Huffman Tree that uses a template class. Implement the template class in such a way as to store any given sentence of text and then traverse the tree to print the sentence back to the console.

Can't get the solution below to work, this solution was copied from a Chegg answer and that was it, no .h files were in that post:

Cannot open source file for the following: #include "book.h" #include "heap.h" #include "huffnode.h" #include "hufftree.h" is one of the many error messages.

Any idea, using Visual Studio Express 2015?

Explanation / Answer

The code seems proper and it should compile. I am assuming the problem lies with the placement of header files within your Visual Studio setup. You'll have to tweak your Project Settings to include these header files, which - according to the error messages that you're seeing, are in NOT placed in your project directory.

Simple hack -
1. Go to Project > Properties > Configuration Properties > C/C++ > General.
2. Here, you'll find a field called "Additional Include Directories"
3. Go on adding the paths to your book.h, heap.h, huffnode.h, hufftree.h (and other files if need be) header files.
4. You should be good to go :)